- Home
- How to make VS Code load faster with a little bit of housekeeping
How to make VS Code load faster with a little bit of housekeeping
If you're a user of Visual Studio Code, you may find that over time it feels like new IDE windows are slow to load. In my experience, loading an environment from a cold start (firing up VS Code when it isn't running at all), or opening a window for a new project (File >> New Window) when Code is already running tend to take about the same amount of time.
This is notably different from opening a new tab within the IDE - again, in my experience, once Code is up and running, new tabs take almost no time to fire up.
Why is it slow?
In its most basic form VS Code is fairly performant - a fresh install of the IDE opens very quickly. Over time, if you're anything like me, you've probably installed any number of community-built extensions from the VS Code Marketplace
The Solution
Well, the good news is that this one is exactly as easy as it sounds - you can gain quite a bit of startup performance by removing unused and unnecessary extensions from VS Code, by opening your Extensions pane (Shift + command + X on a mac, likely control + shift + X on Windows/Linux), and typing @installed into the search bar at the top of the list to see which extensions are currently installed. In my case, it looks like this:
Extensions with particularly long load times will have their "Activation Time" highlighted in this list. It's currently shown in the upper-right corner of the extension list item with a load time in milliseconds listed next to it:
How to remove extensions with long activation times from Visual Studio Code
- Scan through your list of installed extensions, and remove any you don't use
- If there are remaining extensions which have high activation times listed, consider whether there's better options available (and install those!)
- If there aren't better options available, you'll either need to live with the load time for a given extension, or choose to bid it farewell. Worth noting here: these extensions are (generally) open-source, so you may want to visit the repo for that extension and search for "activation time" to see if anyone else is running into the same problem. If not, you might want to open an issue and let the maintainers of that extension know you're having trouble, or open a PR if you have a solution to offer up.
...and that should do ya! If you're still running into performance issues after this, it could be any number of things. Are you running out of disk space on your computer? Maybe you're running out of available RAM? Are you running other applications that slow your machine down?
Additionally, if you're a JavaScript or Node app developer, you may want to check out my article on Reclaiming Disk Space from node_modules.
I hope this helps! Feel free to share it with a friend if you found it useful.
This post was inspired by a tweet I let fly recently after playing with load times in Visual Studio Code:
Frequently asked questions
Why does VS Code get slow to load over time?
A fresh install of VS Code opens very quickly. The slowdown usually comes from the community-built extensions you accumulate over time from the VS Code Marketplace. Each one adds to startup, so removing the ones you do not use is the easiest win.
How do I see which extensions are installed?
Open the Extensions pane (Shift + command + X on Mac, likely
control + shift + X on Windows/Linux) and type @installed into the
search bar at the top of the list. That shows every extension currently
installed so you can decide what to keep.
How do I find which extension is slow?
Extensions with particularly long load times have their Activation Time highlighted in the installed list, shown in the upper-right corner of each extension's list item with a load time in milliseconds next to it. That badge points you straight at the worst offenders.
What should I do about an extension with a high activation time?
First decide whether you actually use it; if not, remove it. If you do, check whether a faster alternative exists and switch to it. If there is no better option, you can live with the load time or remove the extension. Since most are open source, it is also worth searching that extension's repo for "activation time" to see if others hit the same issue, and opening an issue or PR if needed.
Does this fix work on Apple Silicon Macs?
The tips here are still valid, but if you are on a Mac with an Apple Silicon chip (M1, M1 Pro, or M1 Max) you should do the Apple Silicon speedup first. You will see much bigger gains from that step, then come back here to clean up extensions.
note: Cover photo for this article is from by Djim Loic on Unsplash.
