I have installed Ubuntu 18.04 LTS I used to use Visual Studio Code for my projects but the problem is that it is very slow. It hooks or locks, I do not know how to put it so that they understand me, because I use the translator and I do not know what will be better. The fact is that it is very bad, both in this version and in 16.04. I also have it in Windows and it works perfectly. Sometimes it crashes, blocking all processes and denying access to the computer. Does that have something to do with Ubuntu, should I optimize it in any way? If you give me some idea, well, as I said, I got used to Visual Studio and I tried Sublime text-3 which is much better, but I should get used to it and I do not like it very much. Forgive the syntax, I must use the translator. Thank you.
From https://code.visualstudio.com/docs/editor/integrated-terminal:
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)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
whenwriting text
andselecting 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 to60hz
.if you have a secondary external monitor (laptop user case), then:
check your gpu refresh rate.
(for example you find 60hz)go to settings
make secondary monitor primary
disable built-in display
(laptop display)set secondary monitor to 60hz
reboot
for me, this option with
refresh rate
worked like a charm. right now its not lagging anymore when typing/selectin text and im usingmanaro 21 xfce
. i know, why talking about manjaro on askubuntu, but i had the same problem inubuntu 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 installedit overrides the control
. vim extension is single-threaded and not very well optimized and when you type you may have bad performance, souninstall
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. useproprietary
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
As of Feb 2022, some systems still experience poor performance in the latest VS Code with default settings on Ubuntu 20.04. However, the options below have been known to resolve the issue. YMMV, depending on system configuration and hardware.
The most likely culprit for general slowness of Electron apps on Linux is a lack of GPU acceleration, which is (often? always?) disabled by default. To check whether the underlying Chromium engine provides hardware acceleration to VS Code:
code --status
If hardware acceleration appears to be disabled, (e.g.,
webgl: disabled_software
,skia_renderer: enabled
), performance will likely suffer until that's addressed.Option 1: Ignore GPU Blacklist
In some cases, Electron/Chromium may prevent VS Code from enabling GPU acceleration due to a blacklist, which can be disabled by launching VS Code with
code --ignore-gpu-blacklist
. It's expected that the following warning appears:The difference will be very noticeable if this worked, particularly in the integrated terminal.
Option 2: Edit Terminal Rendering Setting
According to the vscode docs, the integrated terminal renderer can be changed with the setting,
terminal.integrated.gpuAcceleration
. The default value is"auto"
."terminal.integrated.gpuAcceleration": "on"
or"auto"
)"terminal.integrated.gpuAcceleration": "canvas"
"terminal.integrated.gpuAcceleration": "off"
)Note that it can be difficult to confirm whether vscode is obeying this setting. (Please, someone update this answer if you know how to check this!)
(Older versions of vscode had a similar setting,
terminal.integrated.rendererType
, which no longer exists.)Option 3: Check Video Card Drivers
Linux tools provide many ways to check video card drivers, and the methods for updating drivers vary by manufacturer and preferences about third party. That's outside the scope of this question, but
sudo lshw -c video
sudo apt-get install mesa-tools; glxgears
about:support
page has heaps of video card & driver info.Option 4: Look for Misbehaving Extensions
Even though that symptom hints at another problem, start with the GPU acceleration options above because other performance issues may be harder to track down. Next, disable extensions to narrow down whether the performance drag comes from vscode itself or a misbehaving extension. Tools like
top
can also be used to determine which process is overusing resources.Option 5: Reinstall VS Code
I'm almost embarrassed to add this option, but it saved me today. After some updates (and a system restart),
--ignore-gpu-blacklist
stopped working, and nothing I tried could fix it. After tracking down a few of the errors incode --status
, I concluded that there might be something wrong with the Snap package for VS Code. I downloaded the .tar.gz from the website, and thankfully the hardware acceleration is working again.Option 6: Profile VS Code
I haven't gotten this far down the list, but if nothing else works, there is a way to profile vscode itself with dev tools.
In my case that was the workspace issue, It had become too big - a lot of data including photos was in a folder. After I moved the data folder outside the workspace, it became so much smoother with nearly no delay.
I have a RTX GPU and laptop (Nitro 5) having 144Hz display, connected to a Dell Ultrasharp monitor with 60 Hz display.
I had performance problem, that is lagging with first Chrome.I thought it was something to do with memory and deleted the kubernetes kind cluster running in my machine. But still there was this problem. Then installed firefox and was happy with that.
But then I opened VS Code and the same problem there. I read somewhere that both Chrome and VSCode has this Electron based backend. So I figured it was not the memory but something else. I tried to disable the GPU setting as was given in other answers. To no avail.
Then I just made the laptop screen as primary and my extended display as secondary and the problem disappeared !
Note i use PopOS which is based on Ubuntu