Did your VSCode startup also become unbelievably slow in the last months?
Are you running into "VSCode not responding" or "Another instance of code is running but not responding"?
You have no idea why, and already tried a lot of fixes?
Then this blog entry might be for you!
First, have you already tried the following VSCode slow fixes?
- Remove unneeded extensions
- Disable extensions
- Backup & remove your settings to start with default configuration
- Start from WSL, start from Windows, ...
- Reinstalling VSCode (will typically keep your extensions and settings!)
- Read thousands of GitHub issues and blog entries how to fix things?
But you were not successful and VSCode is still super slow? Then you might right here!
First, once again, the reason for your startup issues might be totally different, so please try the steps above first and take backups before!
Try if one of the following tests fixes your VSCode being slow issues:
If that doesn't help, you should give the following commands a try to start VSCode with features disabled. Open commandline (on windows for example enter "cmd" in search) and then try the following one by one:
code --disable-extensions
code --disable-gpu
code --disable-sandbox
Test with each one, if it solves your problem and files open fast again. If that's the case, look for related issues at Google to get a final fix!
Also try to uninstall and install VSCode again. Your Extensions, settings, etc. should be kept (at least they were kept in my case ;))
Fixed finally (for me):
The following is for experts only, but as you're using VSCode, you might be one ;)
Sadly for me, all these things did not fix the lazy startup and file opening issue. What really helped, was removing the VSCode users directory to be recreated automatically.
I'll show you how to test this in a dry-run before and finally clean up in the next steps:
1. Dry-run with fresh user data directory
VSCode provides a wonderful parameter for the user data directory, so it's easy to take a dry run with a new, freshly generated test user data directory.
1. Close all VSCode instances
2. Open your commandline ("cmd") and enter something like:
code --user-data-dir c:\TEST-VSCODE-DELETEME
this will start a fresh VSCode instance with a fresh user data directory created at c:\TEST-VSCODE-DELETEME
if this VSCode runs fast for you're now, you've got a good chance, that you're running into the same issue as I did.
3. You may want to close the VSCode instance again and delete the dummy directory at c:\TEST-VSCODE-DELETEME. You won't need it anymore.
Now proceed to the final cleanup step (2) below.
If not, this probably isn't the right fix for you!
2. Clean up the real user data directory
1. Open the VSCode user directory. On Windows 10 it is typically:
%userprofile%\AppData\Roaming\Code
You can copy & paste this into your Windows explorer address bar.
2. Close all VSCode instances
3. Take a backup of the "Code" folder. If something doesn't work, you can so restore
3. Delete the "Code" folder and afterwards start VSCode. VSCode will now regenerate that folder and restore all your extensions, etc.
Have a more happy coding day and more time for your family and friends ;)
For other non-Windows OS
I was running into this issue on Windows 10, so I don't know if the same issue may also exists for other operating systems. If it does, I guess there may be a similar directory in the home (~) directory, which you could try to clear.
Other optimizations and helpful tips
When looking for solutions to my issue I found the following article and think it's worth reading for most of us VSCode users: https://www.freecodecamp.org/news/optimize-vscode-performance-best-exte…
Also see https://github.com/microsoft/vscode/wiki/Performance-Issues#visual-stud…