vscode: VS Code starts slowly when the Settings editor is open
- ⚠️ We have copied additional data to your clipboard. Make sure to paste here. ⚠️
- ⚠️ 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)
@rzhao271 One observation is that opening a settings editor is calling the
inspect
method ~1600 times. I am assuming we are callinginspect
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()
orsettingsTree.setChildren()
withdiffIdentityProvider
to rerender the setting tree more efficiently, but I have not looked into it yet.Before
After
👏 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
@rzhao271 With these steps I can reproduce the freeze
onDidChangeRestrictedSettings
event via this callbackThis 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