vscode: VS Code starts slowly when the Settings editor is open

  1. ⚠️ We have copied additional data to your clipboard. Make sure to paste here. ⚠️
  2. ⚠️ Make sure to attach these files from your home-directory: ⚠️ -prof-QZ5MV1W0.main.cpuprofile.txt -prof-QZ5MV1W0.renderer.cpuprofile.txt prof-QZ5MV1W0.main.cpuprofile.txt prof-QZ5MV1W0.renderer.cpuprofile.txt

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

@rzhao271 One observation is that opening a settings editor is calling the inspect method ~1600 times. I am assuming we are calling inspect for every setting even if it is not rendered. One good low hanging improvement we can do here is reducing the number of inspect calls - inspect only when a setting is visible/rendered. We show a max of 15-20 settings and if we can avoid calls for other settings, we would gain more than 95%.

#190100 adds in a change that calls inspect more lazily. @jrieken let me know if you notice an improvement or have any concerns.

One remaining area of potential improvement I know of would be to use settingsTree.rerender() or settingsTree.setChildren() with diffIdentityProvider to rerender the setting tree more efficiently, but I have not looked into it yet.

Before

The createSettingsTreeGroupElement call takes as long as the deltaConfiguration call

After

The createSettingsTreeGroupElement call is much faster than the deltaConfiguration call

👏 Nice, so much better now

@rzhao271 Thanks for doing the change

Recently when I open vscode I always get this message, if I click the button to reopen vscode it closes and does not open again Recording 2023-04-14 at 10 10 23

@rzhao271 With these steps I can reproduce the freeze

  • open settings editor
  • reload window
  • there is very slow handling of the onDidChangeRestrictedSettings event via this callback

This aligns with my (out of dev) profiling and the attached CPU profile. Check minified source code of the 1.77.1 release and the Hc function on line 2311

Screenshot 2023-04-12 at 08 59 01 Screenshot 2023-04-12 at 08 59 22