Closed tsmaeder closed 3 months ago
Note that while the IDE is blocked, no syntax coloring is visible.
Note that the same operation causes no noticeable delay on VS Code.
Quick profile reveals that ~100% of the time is spent in DiffComputer.computeDiff
. Displaying the dirty diff seems to take a long time. Maybe https://github.com/eclipse-theia/theia/pull/13104/files introduced a performance hit we did not notice.
VS Code seems to delegate diff computation to the editor service worker while we do it in the main thread. Opening electron.d.ts. one can observe a spike in CPU usage as well (although only couple of seconds, probably 10% of the time it takes Theia), but the main UI is not blocked.
Since electron.d.ts
is not under version control, the dirty diff is between an empty string the contents of electron.d.ts. Just doing such a line diff in a nodejs script takes over 20 seconds, so we can't expect to reduce that time significantly for that application case.
I prototyped using the LcdDiff code from VS Code and that seems to be orders of magnitude faster. WTF?
Turns out jsdiff itself seems to have made great strides since the 3.x version we have been using: simply updating the library makes the problem totally disappear (diff takes miliseconds).
Bug Description:
Opening
electron.d.ts
blocks the IDE with high CPUSteps to Reproduce:
electron-main-application.ts
and control-click any type from electrontelectron.d.ts
opens in a browser, then the IDE is blocked for around 15 seconds with high CPU usage.Additional Information