Skip to content

Improve workbench start-up performance #15455

Closed

Description

Startup performance for some users is very bad and we should understand why.

Activity

  1. bpasero commented on Nov 14, 2016

    @bpasero
    Contributor

    Some ideas:

  2. jrieken commented on Nov 18, 2016

    @jrieken
    ContributorAuthor

    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

  3. bpasero commented on Nov 18, 2016

    @bpasero
    Contributor

    Johannes Rieken (@jrieken) so instead of

    this.viewletService = this.instantiationService.createInstance(ViewletService, this.sidebarPart);
    serviceCollection.set(IViewletService, this.viewletService);
    

    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).

  4. jrieken commented on Nov 18, 2016

    @jrieken
    ContributorAuthor

    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

  5. added
    plan-item
    on Nov 19, 2016
  6. shanalikhan commented on Dec 14, 2016

    @shanalikhan

    it takes about 5 second to load in my machine, latest update 1.8

  7. jrieken commented on Dec 20, 2016

    @jrieken
    ContributorAuthor

    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

  8. 34 remaining items

  9. jrieken commented on Jan 26, 2017

    @jrieken
    ContributorAuthor

    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...

  10. jrieken commented on Mar 6, 2017

    @jrieken
    ContributorAuthor

    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.

  11. csholmq commented on Mar 7, 2017

    @csholmq

    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?

  12. PowerWeb5 commented on Mar 7, 2017

    @PowerWeb5

    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.

  13. PowerWeb5 commented on Mar 8, 2017

    @PowerWeb5

    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.

  14. jrieken commented on Mar 8, 2017

    @jrieken
    ContributorAuthor

    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

  15. csholmq commented on Mar 9, 2017

    @csholmq

    Johannes Rieken (@jrieken) Seems to be must better now when I tested. <5 seconds which is reasonable.

  16. Hamido-san commented on Jul 26, 2017

    @Hamido-san

    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...

  17. tovin07 commented on Oct 11, 2017

    @tovin07

    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.7601

    • CPUs: 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, 0
      66f9_renderer.cpuprofile.txt

    • VM: 0%

    • Initial Startup: yes

    • Screen Reader: no

    • Empty Workspace: yes

    • Timings:

    Component Task Time (ms)
    main start => app.isReady 1060
    main app.isReady => window.loadUrl() 1741
    renderer window.loadUrl() => begin to require(workbench.main.js) 3197
    renderer require(workbench.main.js) 3967
    renderer create extension host => extensions onReady() 2480
    renderer restore viewlet 2379
    renderer restore editor view state 281
    renderer overall workbench load 3129
    main + renderer start => extensions ready 13096
    main + renderer start => workbench ready 13117

    ⚠️ Make sure to attach these files from your home-directory: ⚠️
    -66f9_main.cpuprofile.txt
    -66f9_renderer.cpuprofile.txt
    66f9_main.cpuprofile.txt
    66f9_renderer.cpuprofile.txt

  18. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

perfplan-item

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions