microsoft / vscode

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

Integrated Terminal - Long Delay After Each Command #214523

Closed HayDegha0917 closed 5 months ago

HayDegha0917 commented 5 months ago

Type: Performance Issue

  1. Upgrade VS Code to v1.90
  2. Open a terminal. It takes about 3 seconds to get a prompt.
  3. Type in a command (e.g., "ls")
  4. The output shows immediately, and the Command Action indicator (blue dot in left margin) is updated immediately. However, it takes another 3 seconds to get the prompt.
  5. Repeat ad nauseam and obvserve that the performance does not improve; you still have a 3-second delay after every command.

VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:33:54.889Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2904)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.88GB (16.99GB free)| |Process Argv|--crash-reporter-id 690e2f4b-e58a-4b3b-ad3d-a83c02066111| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 0 112 22372 code main 0 99 1600 window [2] (Issue Reporter) 0 108 9332 shared-process 0 92 12352 gpu-process 0 210 16564 extensionHost [1] 0 121 7604 electron-nodejs (tsserver.js ) 0 121 20396 electron-nodejs (server.js ) 0 110 26936 "C:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\Code.exe" c:\Users\akassabi\.vscode\extensions\streetsidesoftware.code-spell-checker-3.0.1\packages\_server\dist\main.cjs --node-ipc --clientProcessId=16564 0 192 30580 electron-nodejs (tsserver.js ) 0 88 1300 electron-nodejs (typingsInstaller.js typesMap.js ) 0 91 30696 electron-nodejs (eslintServer.js ) 0 98 21320 fileWatcher [1] 0 28 24712 crashpad-handler 0 271 28356 window [1] (src\services\dads.ts - Sit Awareness (Workspace) - Visual Studio Code) 0 101 29436 ptyHost 0 5 1520 "C:\Program Files\Git\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 11 25864 "C:\Program Files\Git\bin\..\usr\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 5 2980 "C:\Program Files\Git\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 12 7868 "C:\Program Files\Git\bin\..\usr\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 6 24504 conpty-agent 0 5 32580 "C:\Program Files\Git\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 12 16704 "C:\Program Files\Git\bin\..\usr\bin\bash.exe" --init-file "c:\Users\akassabi\AppData\Local\Programs\Microsoft VS Code\resources\app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh" 0 6 33028 conpty-agent 0 6 33188 conpty-agent 0 40 30220 utility-network-service ```
Workspace Info ``` | Window (src\services\dads.ts - Sit Awareness (Workspace) - Visual Studio Code) | Folder (cep-server): 52 files | File types: ts(12) js(7) map(7) json(5) env(1) template(1) gitignore(1) | md(1) graphql(1) code-workspace(1) | Conf files: launch.json(1) tasks.json(1) package.json(1) | tsconfig.json(1) | Launch Configs: node; ```
Extensions (43) Extension|Author (truncated)|Version ---|---|--- vscode-django|bat|1.15.0 npm-intellisense|chr|1.4.5 vscode-markdownlint|Dav|0.55.0 vscode-eslint|dba|3.0.7 python-environment-manager|don|1.2.4 python-extension-pack|don|1.7.0 gitlens|eam|15.0.4 vs-code-xml-format|fab|0.1.5 gc-excelviewer|Gra|4.2.59 vsc-python-indent|Kev|1.18.0 MagicPython|mag|1.1.0 vscode-dotnet-runtime|ms-|2.0.5 autopep8|ms-|2024.0.0 debugpy|ms-|2024.6.0 isort|ms-|2023.10.1 python|ms-|2024.8.0 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-containers|ms-|0.369.0 remote-ssh|ms-|0.110.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.88.2 vscode-remote-extensionpack|ms-|0.25.0 hexeditor|ms-|1.10.0 live-server|ms-|0.4.13 remote-explorer|ms-|0.4.3 remote-server|ms-|1.5.1 autodocstring|njp|0.6.1 fix-json|oli|0.1.2 vscode-yaml|red|1.14.0 code-spell-checker|str|3.0.1 shellcheck|tim|0.37.1 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-icons|vsc|12.8.0 vscode-todo-highlight|way|1.0.5 jinja|who|0.0.8 open-in-external-app|YuT|0.10.0 html-css-class-completion|Zig|1.20.0
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelc:31048052 dsvsc021:30996838 01bff139:31013167 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 pythonprt:31056678 dwnewjupyter:31046869 26j00206:31048877 ```
HayDegha0917 commented 5 months ago

Trace-20240606T160139.json See attached profile trace

HayDegha0917 commented 5 months ago

Trace-20240606T160435.json Profile trace after disabling all extensions.

The performance issue is observed when extensions are disabled as well as when they are enabled.

HayDegha0917 commented 5 months ago

Note: I attempted to improve performance by turning off integrated terminal "bells and whistles". These are the final terminal settings:

    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.shellIntegration.enabled": true,
    "terminal.integrated.customGlyphs": false,
    "terminal.integrated.rescaleOverlappingGlyphs": false,
    "terminal.integrated.tabStopWidth": 4,
HayDegha0917 commented 5 months ago

terminal.log Attached is the terminal trace log showing timestamps.

Note, as an example, the timestamps starting at Line 258, after typing the pwd command, until the prompt is rendered again at Line 287. Note, in particular, the ~3 second delay between Lines 279 and 280.

IllusionMH commented 5 months ago

/duplicate of #212090

Current workaround is to disable shell integration "terminal.integrated.shellIntegration.enabled": false until issue is resolved.

vscodenpa commented 5 months ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!