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.
Answer from starball on Stack OverflowI'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.
I encountered this issue on my new Linux Mint laptop, which was quite frustrating. Eventually, I discovered a workaround. Interestingly, I found this solution after experiencing a similar problem with Chromium.
alias code="2>/tmp/vscode_output code --disable-gpu --disable-software-rasterizer \"$@\""
(in /tmp/vscode_output it says: "Warning: 'disable-software-rasterizer' is not in the list of known options, but still passed to Electron/Chromium.")
I am not a windows user but my guess is that the parameters --disable-gpu and --disable-software-rasterizer used in the Linux command can potentially be applied to vscode on windows as well. You can modify the command for windows like this:
doskey code=code --disable-gpu --disable-software-rasterizer $*
This sets up an alias in the windows command prompt similar to the bash alias in Linux. It could help resolve similar issues with vscode on windows systems. (not tested)
VS Code taking a long time to start up
Very slow startup (20-30 seconds)
increasing speed of vs code startup
VSCode Slow startup
The issue is resolved if you put code.exe as an excluded file in McAfee real-time scanning (or whichever antivirus you're using).
The exe is generally found in windows at the location:
C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code
The issue for the original asker of this question was caused by their McAfee AntiVirus and may be related to a recent update of it.
There is related discussion in this VS Code issue ticket: VS Code too slow during startup after recent update #177570 (reported for VS Code 1.76.2)
If you want to add exclusion rules, on Windows, a user install is located under C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code, and a system install under C:\Program Files\Microsoft VS Code\bin.
In the McAfee UI, see My Protection > Real-Time Scanning > Excluded Files > Add File (add the VS Code binary).
I like VS Code, because it's lightweight and relatively fast. But for some reason, it takes a long time (about a minute) to start up on my new laptop.
I have uninstalled and reinstalled it, and removed all extensions. But it's still taking a long time to open. My laptop is an XPS 13 running Windows 11 and it's only a couple of months old. VS Code opens fairly quickly on all of my other machines, except this one.
Has anyone encountered this before?
how can I get vs code to load-up quicker? currently, it takes 10-15 seconds to load up whereas when I was using sublime, it would only take 2-3.
Small (less than 10MiB) size case
- Open plain
.pyfile in same VSCode window. - Close all notebooks.
- Open your notebooks again.
Bigger size case
First of all, I suggest you to wait a bit - due to VSCode extensions render overhead, loading the notebook may took times more time than in your browser. If it doesn't help in adequate time:
- Open the notebook in browser.
- Clear all its outputs.
- Reload VSCode window (e.g. using Command Pallette:
Ctrl+Shift+P->Reload Window)
When I reopened VS Code and immediately opened "Interactive", I also encountered the same problem, sometimes it could not be opened, sometimes it was very slow.
Reason: In VS Code, Since the "Interactive" function is provided by the extension "python", it needs to load the extension "python", then start this function and execute the code.
Solution:
It is recommended that you create or open a python file (.py file) after opening VS Code, wait for the extension and language service to load, and then open and use the "Interactive" function. In addition, in order to shorten the loading time, please disable VS Code extensions that you don't need to use and ensure a good network.
If all the required items are loaded but the "Interactive" window is still open and running slowly, please try to close other applications on the computer and reload or restart VSCode.
Github link: "Python extension loading" super slow.
From https://code.visualstudio.com/docs/editor/integrated-terminal:
By default, the integrated terminal will render using GPU acceleration on most machines. It does this using multiple elements, which are better tuned than the DOM for rendering interactive text that changes often.
However, Electron/Chromium are slower rendering to canvas on some environment and so VS Code also provides a fallback DOM-renderer experience. VS Code will try to detect slow performance and give you the option to change via a notification.
You can also change the rendering directly by setting terminal.integrated.gpuAcceleration in your user or workspace settings. (On Windows/Linux: File > Preferences > Settings)
{
"terminal.integrated.gpuAcceleration`": "off"
}
Something else that might improve performance is to ignore Chromium's GPU blacklist by launching VS Code with code --ignore-gpu-blacklist.
It worked for me, not like a real terminal but better than nothing, I hope this helps!
special thanks to this reddit post.
my problem with vs code: bad performance when writing text and selecting text in the editor. freezes about 0.5 seconds
there are several causes for this problem:
monitor refresh rate
(desktop user case) check you graphics card refresh rate. if you GPU has a max of 60hz then configure your monitor to 60hz.
if you have a secondary external monitor (laptop user case), then:
check your gpu refresh rate.(for example you find 60hz)go to settingsmake secondary monitor primarydisable built-in display(laptop display)set secondary monitor to 60hzreboot
for me, this option with refresh rate worked like a charm. right now its not lagging anymore when typing/selectin text and im using manaro 21 xfce. i know, why talking about manjaro on askubuntu, but i had the same problem in ubuntu 20.04 gnome too, but at that time i wasnt stroke with a refresh rate idea.
vim emulator vs code extension
usually, vs code is handling the keypresses by itself, but when vim extension is installed it overrides the control. vim extension is single-threaded and not very well optimized and when you type you may have bad performance, so uninstall vim extension.
too many extensions
try uninstalling the unimportant extensions or make a sacrifice to reduce the total number.
bad graphics driver
try using other graphics driver. use open-source ones, try performance. use proprietary ones, try performance.
laptop is in power saving mode
try setting your cpu to performance mode.
EDIT date: (11.05.2022)
the problem was my HDD, was too slow. after moved to SSD, performance of writing text is good, because write and read speed from the SSD is faster.
but vs code is still slow. performance is really bad (compared to sublime + im very impatient).
solution: move to sublime text 4.
done.
indeed, vs code is slow