You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Startup performance for some users is very bad and we should understand why.
Reacted by Joao Pedro, Yu Zhang, Sebastian Holmqvist, Mark Heath, Jacob Peddicord, Wayne Yang, Markus, Alfonso Andrés López Molina, Shan Khan, Julian Verdurmen and 11 more
Benjamin Pasero (@bpasero) Why is it that you instantiate all services eager during startup and don't let the instantiation service take care of this? The ServiceCollection also accepts ctor's which it will invoke when a service is being requested. While we still have to instantiate them all it might help getting the workbench show up faster
There is no specific reason for instantiating all the services right on startup so we can try with it. Though many services are simply just interfaces for parts that get created on startup anyway (like the viewlet service).
Like so, serviceCollection.set(IMenuService, new SyncDescriptor(MenuService));
I agree, some services are needed right aways or already instantiated but some aren't. My guess is that the lower half there can be lazy, like ConfigurationEditing
Shan Khan (@shanalikhan) Can you do this: Hit F1, type Startup Performance, hit Enter. It will open dev tools and print some startup stats. Can you share them with me please
There is a discussion about virus scanners and bad perf of Electron apps: electron/electron#1487. As it seem VS Code isn't the only app that's affected by this...
Closing this because it has served as an umbrella item to collect general ideas and feedback. Because of the amount of perf work we have added the 'perf' and 'perf-profile' tag which every one should look for.
Johannes Rieken (@jrieken) What is considered 'good' startup time and what is considered 'bad'?
On Win10, cold start is >10s. Which to me feels way too long. But perhaps is in the ballpark?
Please see #18514 for additional benchmarking details, as well as pinpointed cause of 10.5 second startup times. I describe a workaround to bring startup time down to 3.3 seconds. I suggest anyone with Malwarebytes make those changes.
However, as pointed out there, any disk access overhead (whether due to anti-virus or potentially just slow disks) seems to have a much greater impact on VS Code.
You can see this in how, whether those anti-virus features were enabled made no difference in Notepad++ and OneNote startup times, which were 0.7 seconds and 1.7 seconds respectively, and how VS Code still takes 3.3 seconds to open, which is nearly 5x Notepad++ (with many plugins enabled) and nearly 2x OneNote (which I would have thought would take longer to open, especially with web hosted/synced/shared Notebooks).
Accordingly, I would suggest deferring extension and feature loading until after the opened document is displayed (similar to what is done with spellcheck underling and content/code language determination being delayed until after that), as discussed further in #18514.
I have provided screenshots, log files, Steps to Reproduce, and manual startup measurements (time until the document contents are displayed - the most important startup metric IMO) all in #18514, for various cases, with and without extensions, and with and without Malwarebytes features which cause slower startup being enabled.
Sebastian Holmqvist (@csholmq) A good startup should be in the range of 3 seconds, maybe 5 but everything > 10 is a disaster. Can you run latest insiders from the command line like so: code-insiders --prof-startup. That will create CPU profiles for the main and renderer process which we then can analyse. Happy Coding
Doesn't really matter that much if it takes 0.5 or 5 seconds to open the main window.
What feels jarring every single time is the delay between when the VSCode window opens & when a simple text file is finally shown inside!
That's what makes me look for a faster alternative, like I dunno, MS Word?!?
Sorry if I sound bitter, but this seems like the most basic of UX principles...
Activity
bpasero commentedon Nov 14, 2016
Some ideas:
jrieken commentedon Nov 18, 2016
Benjamin Pasero (@bpasero) Why is it that you instantiate all services eager during startup and don't let the instantiation service take care of this? The ServiceCollection also accepts ctor's which it will invoke when a service is being requested. While we still have to instantiate them all it might help getting the workbench show up faster
bpasero commentedon Nov 18, 2016
Johannes Rieken (@jrieken) so instead of
doing
serviceCollection.set(IViewletService, ViewletService);?
There is no specific reason for instantiating all the services right on startup so we can try with it. Though many services are simply just interfaces for parts that get created on startup anyway (like the viewlet service).
jrieken commentedon Nov 18, 2016
Like so,
serviceCollection.set(IMenuService, new SyncDescriptor(MenuService));I agree, some services are needed right aways or already instantiated but some aren't. My guess is that the lower half there can be lazy, like ConfigurationEditing
More lazy loading of services (for #15455)
open main window ~30ms sooner by moving menu creation out, #15455
shanalikhan commentedon Dec 14, 2016
it takes about 5 second to load in my machine, latest update 1.8
jrieken commentedon Dec 20, 2016
Shan Khan (@shanalikhan) Can you do this: Hit F1, type Startup Performance, hit Enter. It will open dev tools and print some startup stats. Can you share them with me please
34 remaining items
jrieken commentedon Jan 26, 2017
There is a discussion about virus scanners and bad perf of Electron apps: electron/electron#1487. As it seem VS Code isn't the only app that's affected by this...
jrieken commentedon Mar 6, 2017
Closing this because it has served as an umbrella item to collect general ideas and feedback. Because of the amount of perf work we have added the 'perf' and 'perf-profile' tag which every one should look for.
csholmq commentedon Mar 7, 2017
Johannes Rieken (@jrieken) What is considered 'good' startup time and what is considered 'bad'?
On Win10, cold start is >10s. Which to me feels way too long. But perhaps is in the ballpark?
PowerWeb5 commentedon Mar 7, 2017
Johannes Rieken (@jrieken) Benjamin Pasero (@bpasero)
Please see #18514 for additional benchmarking details, as well as pinpointed cause of 10.5 second startup times. I describe a workaround to bring startup time down to 3.3 seconds. I suggest anyone with Malwarebytes make those changes.
However, as pointed out there, any disk access overhead (whether due to anti-virus or potentially just slow disks) seems to have a much greater impact on VS Code.
You can see this in how, whether those anti-virus features were enabled made no difference in Notepad++ and OneNote startup times, which were 0.7 seconds and 1.7 seconds respectively, and how VS Code still takes 3.3 seconds to open, which is nearly 5x Notepad++ (with many plugins enabled) and nearly 2x OneNote (which I would have thought would take longer to open, especially with web hosted/synced/shared Notebooks).
Accordingly, I would suggest deferring extension and feature loading until after the opened document is displayed (similar to what is done with spellcheck underling and content/code language determination being delayed until after that), as discussed further in #18514.
PowerWeb5 commentedon Mar 8, 2017
I have provided screenshots, log files, Steps to Reproduce, and manual startup measurements (time until the document contents are displayed - the most important startup metric IMO) all in #18514, for various cases, with and without extensions, and with and without Malwarebytes features which cause slower startup being enabled.
jrieken commentedon Mar 8, 2017
Sebastian Holmqvist (@csholmq) A good startup should be in the range of 3 seconds, maybe 5 but everything > 10 is a disaster. Can you run latest insiders from the command line like so:
code-insiders --prof-startup. That will create CPU profiles for the main and renderer process which we then can analyse. Happy Codingcsholmq commentedon Mar 9, 2017
Johannes Rieken (@jrieken) Seems to be must better now when I tested. <5 seconds which is reasonable.
Hamido-san commentedon Jul 26, 2017
Doesn't really matter that much if it takes 0.5 or 5 seconds to open the main window.
What feels jarring every single time is the delay between when the VSCode window opens & when a simple text file is finally shown inside!
That's what makes me look for a faster alternative, like I dunno, MS Word?!?
Sorry if I sound bitter, but this seems like the most basic of UX principles...
tovin07 commentedon Oct 11, 2017
Slow as f*ck :((
66f9_main.cpuprofile.txt
VSCode Version:
Code - Insiders 1.18.0-insider (dcd1aa35dfa590b4a528e1ab55e957002f430f17, 2017-10-10T05:26:33.683Z)OS Version:
Windows_NT x64 6.1.7601CPUs:
Intel(R) Core(TM) i7-4610M CPU @ 3.00GHz (4 x 2993)Memory (System):
7.88GB (4.34GB free)Memory (Process):
195.05MB working set (195.25MB peak, 183.58MB private, 36.27MB shared)Load (avg):
0, 0, 066f9_renderer.cpuprofile.txt
VM:
0%Initial Startup:
yesScreen Reader:
noEmpty Workspace:
yesTimings:
-
66f9_main.cpuprofile.txt-
66f9_renderer.cpuprofile.txt66f9_main.cpuprofile.txt
66f9_renderer.cpuprofile.txt