microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.59k stars 29.03k forks source link

General lagging and high cpu usage #215512

Closed hp-peti closed 4 months ago

hp-peti commented 4 months ago

Type: Performance Issue

Just trying to use the environment for regular work. Editing any kind of text file or even typing into the top bar is lagging and generating high cpu. Scrolling is also choppy, especially with custom views such as the popular Git Graph extension.

I have observed the issue in VS Code Insiders a couple of days ago to the point i stopped using it. VS Code Dev (online) and previous version (rev 160) did not suffer of this problem.

VS Code version: Code 1.90.1 (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:02:43.666Z) OS version: Linux x64 6.5.0-35-generic snap Modes:

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-1260P (16 x 2100)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|3, 3, 2| |Memory (System)|15.30GB (6.95GB free)| |Process Argv|--force-user-env --no-sandbox --use-gl=angle --use-angle=swiftshader| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu-wayland| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu-wayland| |XDG_SESSION_TYPE|wayland|
Process Info ``` CPU % Mem MB PID Process 0 188 120125 code main 0 31 120127 zygote 0 31 120128 zygote 0 360 120212 window [1] (opx_config.py (Working Tree) (opx_config.py) - eq1x-scripts - Visual Studio Code) 0 94 120863 window [2] (Issue Reporter) 0 63 120159 utility-network-service 0 94 120260 ptyHost 0 0 120332 /usr/bin/bash --init-file /snap/code/161/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 0 120342 /usr/bin/bash --init-file /snap/code/161/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 0 120349 /usr/bin/bash --init-file /snap/code/161/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 0 120352 /usr/bin/bash --init-file /snap/code/161/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 0 120359 /usr/bin/bash --init-file /snap/code/161/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh 0 266 120261 extensionHost [1] 0 31 120537 /home/phanos/miniconda3/envs/eq1x-scripts/bin/python /home/phanos/.vscode/extensions/charliermarsh.ruff-2024.26.0-linux-x64/bundled/tool/server.py 0 31 120538 /home/phanos/miniconda3/envs/eq1x-scripts/bin/python /home/phanos/.vscode/extensions/ms-python.mypy-type-checker-2023.6.0/bundled/tool/lsp_server.py 0 31 120640 electron-nodejs (de.js ) 0 78 120706 electron-nodejs (server-node.js ) 0 63 120835 /snap/code/161/usr/share/code/code /snap/code/161/usr/share/code/resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=120261 3 141 120297 shared-process 0 16 120762 /snap/code/161/usr/share/code/bin/code-tunnel tunnel --accept-server-license-terms --log info --name phanos-equal1-ub --parent-process-id 120297 0 0 120876 /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 0 120877 /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 125 120298 fileWatcher [1] ```
Workspace Info ``` | Window (opx_config.py (Working Tree) (opx_config.py) - eq1x-scripts - Visual Studio Code) | Folder (eq1x-scripts): 17682 files | File types: json(7220) py(3360) yaml(1040) svg(339) txt(300) pyc(285) | rst(281) html(246) doctree(237) png(199) | Conf files: makefile(11) dockerfile(8) github-actions(3) launch.json(2) | settings.json(1) | Launch Configs: debugpy(5); ```
Extensions (23) Extension|Author (truncated)|Version ---|---|--- ruff|cha|2024.26.0 macos-modern-theme|dav|2.3.19 bottom-terminal|fua|0.0.5 vscode-github-actions|git|0.26.3 vscode-pull-request-github|Git|0.88.1 vscode-github-actions|me-|3.0.1 git-graph|mhu|1.30.0 debugpy|ms-|2024.7.11591012 mypy-type-checker|ms-|2023.6.0 python|ms-|2024.9.11641010 vscode-pylance|ms-|2024.6.1 jupyter|ms-|2024.5.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.18 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-ssh|ms-|0.112.2024053015 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.4.3 remote-server|ms-|1.5.2 vsliveshare|ms-|1.0.5932 autodocstring|njp|0.6.1 vscode-yaml|red|1.15.0
hp-peti commented 4 months ago
paulik123 commented 4 months ago

This also happens to me. It makes all my 12 cores go to 100% when I select text.

shelvesdragon commented 4 months ago

This is likely related to the workaround in #212494 being implemented as a temporary fix to crashes on startup with the snap package. Since the issue was only partially resolved, it is recommended to revert to 1.89.1/snap revision 159 since that avoids the crashes or to switch to the debian package until the issue is resolved.

Please revert to v1.89 or use debian package till this issue is fixed. https://github.com/microsoft/vscode/issues/212494#issuecomment-2166941209

Snap revert:

sudo snap revert code --revision 159

Properly installing debian package with signature checks working can be found in this comment: https://github.com/microsoft/vscode/issues/212494#issuecomment-2119250968

hp-peti commented 4 months ago

Duplicate reports so far:

AvesekShrestha commented 4 months ago

This also happens to me. Lagging when typing and scrolling

nadar commented 4 months ago

Same!

Snap revert:

sudo snap revert code --revision 159

error: cannot revert "code": cannot find revision 159 for snap "code"

Instead, the following revert command without a specific version worked for me:

sudo snap revert code
RicardoM17 commented 4 months ago

Same here, running 1.90.1 as well. Everything was perfectly fine yesterday.

This version is completely unusable. Reverting to previous version and it works as normal. Thanks for the quick temp fix @nadar

mntolia commented 4 months ago

Same here on my Ubuntu 22.04. Everything is super slow. I temporarily fixed it by disabling GPU acceleration: code --disable-gpu

briskycat commented 4 months ago

Not only is version 1.90.1 very slow, but it also crashed on me when I scrolled through the release notes (which were also very laggy). I'm on Ubuntu 22.04 as well, running VS Code from snap. Rolling back to the 159 release fixes the sluggishness.

PeepoFrog commented 4 months ago

same issue

reverting to 1.90.0 helps

filippocastelli commented 4 months ago

confirmed issue on two different machines (ubuntu 23.10 and ubuntu 24.04) running snap code 1.90.1 611f9bfc release

100% cpu usage by simple text scrolling on both machines, no extensions enabled Solved by uninstalling the snap version and reinstalling the .deb release.

Stuff like this - completely breaking usability on a whole release line - should not be passing QA

immagine

shelvesdragon commented 4 months ago

Snap revert:

sudo snap revert code --revision 159

error: cannot revert "code": cannot find revision 159 for snap "code"

To switch to revision 159/v1.89.1 if it is not in your snap revision history anymore, (error: cannot revert "code": cannot find revision 159 for snap "code"), you can remove and reinstall VSCode with:

sudo snap remove code

And reinstall revision 159 with:

sudo snap install code --revision 159 --classic

Note: This will keep revision 159 only until the next release is published and will not remove user data, i. e. opened workspace, extensions etc.

deepak1556 commented 4 months ago

Merging to https://github.com/microsoft/vscode/issues/212494, please follow the issue for updates.