0

Three weeks ago, I ditched Sublime in favour of Visual Studio Code. Everything was going great till the program started taking upwards of 30 seconds to start up (launch, show visual feedback) and another 20 or so to boot up (fill in syntax colours, load extensions, and stop stuttering). In the worst instances, it takes minutes to boot up (I used a stopwatch).

At first, I guessed that extensions cost me a lot in start-up time, so I uninstalled most of them. After that, I added 2GB of RAM to my system, moved my CPU to another laptop (smaller chassis, less PPI), swapped my HDD to an SSD, and reinstalled Windows. I didn't make these changes to help VS Code's start/boot time but for other reasons. But even after all these upgrades, VS Code's start-up time seems to increase as time goes by (even without changes to my "Workbench"). Is this normal? What makes it so?


  • My PC setup is: Core i5 520M @ 2.4 Ghz, 6GB DDR3 RAM, 128GB Micron SSD.
  • My VS Code setup has five extensions installed, about thirteen lines in settings.json (including autoSave, JetBrains Mono font, colour themes for Light and Dark mode), and syncs settings to my Microsoft/GitHub account.
starball
  • 20,030
  • 7
  • 43
  • 238
skrewde
  • 1
  • 3
  • It's an Electron app, so.. not renown for speed or efficiency. However it get the job done, and it has plenty features. – Barry the Platipus Jul 17 '22 at 18:31
  • Still, to take 30 seconds is definitely unusual. I have quite a few on mine and it does not usually take a few seconds to run. Have you tried disabling _all_ extensions (https://code.visualstudio.com/docs/editor/extension-marketplace)? – Leaderboard Jul 17 '22 at 18:37
  • Honestly, I have not tried disabling all. I only left extensions that dealt with HTML, CSS, JS, and the Prettier extension. – skrewde Jul 17 '22 at 18:58
  • Lately I'm seeing terrible start-up times for VS Code as well across the board on every install (multiple Windows 10/11 desktops, Windows Servers). All of them are taking 20-40 seconds on the initial startup for the day, then maybe 5-10 seconds to start up each time after that. Some of them have 0 extensions installed, and it's the same. That seems extremely slow for what the app is for. Some of these devices are brand new machines with 32+ GB RAM and new CPUs. So that doesn't seem to matter. On fresh installs of VS Code, the initial start-up time is usually between 1-3 minutes now. – Bryan Williams Jul 03 '23 at 14:13

2 Answers2

0

Since you've mentioned a DDR3 RAM I assume your system is quite old and 520M i5 CPU is really old (It's a 1st gen processor). Do you have similar problems with any other applications or is it just VSCode?

If you are confident that your system is not the problem you can try this;
As others have noted, It is based on Electron so under the hood you have Node & Chromium. You cannot have high expectations from something built on Electron which is known for it's notorious memory footprints. However, 30 seconds startup time is still long. It takes roughly 5-6 seconds in my machine to load and become fully functional, with 9 extensions installed (which are quite large extensions btw).

Another note here is that even when you uninstall a VSCode plugin/extension the directory of that extension never gets removed, VSCode just marks them as Obsolete in a JSON file and keeps the directories for whatever reason. You could try uninstalling & reinstalling, which might help. A simple uninstall will not be of much help since VSCode has cache & configuration directories that are not typically removed upon an uninstall. You'd have to manually remove them. If you are on a Windows machine check
C:\Users\<your name>\.vscode,
C:\Users\<your name>\AppData\Local\Microsoft and
C:\Program Files\Microsoft VS Code
for any leftovers related to VSCode and remove them.

The reason for this to wipe the previous install without any trace (you'll lose all your customizations since they are stored & kept in these directories even after uninstalls, so that when you reinstall, VSCode can access & load your previous configurations which makes your life easier btw)
Try reinstalling after. If you are on a UNIX system look up the equivalent directories, remove the leftovers and do a clean reinstall. Hope this helps.

  • I implemented your suggestion and I'll be watching startup time closely over the next few days. So far, it's been great: 2-3 seconds to start up and about 8-15 to boot. – skrewde Jul 19 '22 at 15:54
0

I'd check out https://github.com/microsoft/vscode/wiki/Performance-Issues#slow-startup. There are instructions there for using code --prof-startup to gather profile files if you want to report an issue ticket, and instructions on how to read startup timers by using the Developer: Startup Performance command in the command palette.

You can also find out how long each extension is taking to load by using the Developer: Show Running Extensions command in the command palette, which will show activation times for all enabled extensions, and whether the extension was activated during startup, or later after startup finished. If there are extensions that you don't typically use in all your workspaces that are slow to activate, I'd suggest you disable them globally and enable them on a per-workspace basis.

If you have any antivirus enabled, check if performance improves if you temporarily disable it. If startup time changes noticeably, then find out if your antivirus has any configuration points to make it ignore VS Code (VS Code has a workspace trust mechanism that can help protect you, but of course, use your own judgement as to whether you can tolerate possible other risks). Ex. VS Code is not responding (Slow Startup and Unresponsive) even with extensions disabled.

starball
  • 20,030
  • 7
  • 43
  • 238