microsoft / vscode

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

Sluggish Autocomplete #175416

Closed markcalendario closed 1 year ago

markcalendario commented 1 year ago

Type: Performance Issue

When the node_module is present, the VSCode autocomplete feature starts to slow down.

VS Code version: Code 1.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:32:34.589Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-3470T CPU @ 2.90GHz (4 x 2893)| |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: unavailable_off
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: unavailable_off
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|7.96GB (3.39GB free)| |Process Argv|--crash-reporter-id d79b2d47-aedc-40cf-ba2b-1d4c33e93743| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 0 104 7840 code main 0 100 1800 shared-process 0 87 972 fileWatcher 0 74 5592 ptyHost 0 42 5220 utility-network-service 0 270 5600 window (Running Extensions - learningaxies - Visual Studio Code) 1 93 7516 issue-reporter 0 27 8156 crashpad-handler 0 127 9092 extension-host 0 126 1908 "C:\Users\markc\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\markc\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\markc\AppData\Local\Temp\vscode-typescript\25987671dffe9b3fb59a\tscancellation-c28f0c6373a8f39b86f7.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc 0 935 3832 "C:\Users\markc\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Users\markc\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\markc\AppData\Local\Temp\vscode-typescript\25987671dffe9b3fb59a\tscancellation-2208d505224d9909d7a0.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc 0 104 9784 "C:\Users\markc\AppData\Local\Programs\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Users/markc/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/markc/AppData/Local/Microsoft/TypeScript/4.9 --enableTelemetry --typesMapLocation "c:/Users/markc/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation 0 73 11168 gpu-process ```
Workspace Info ``` | Window (Running Extensions - learningaxies - Visual Studio Code) | Folder (learningaxies): 355 files | File types: js(77) svg(70) png(57) scss(48) jpg(21) mp3(7) json(5) | mp4(4) webp(4) gitkeep(4) | Conf files: package.json(2); ```
Extensions (1) Extension|Author (truncated)|Version ---|---|--- material-icon-theme|PKi|4.24.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscorecescf:30445987 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vscaac:30438847 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 pyindex848:30662994 nodejswelcome1:30587005 2e4cg342:30602488 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 a9j8j154:30646983 pythonb192:30669360 ```
markcalendario commented 1 year ago

Observations

  1. Upon starting the VSCode, the autocomplete and intellisense is quick.
  2. Once the Typescript and Javascript Language Features loaded, things starts to slow down.
  3. The code suggestion takes 3-5 seconds to appear.
mjbvz commented 1 year ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

If it does, please share a small project which demonstrates the issue

markcalendario commented 1 year ago

Here's the demonstration about the issue. The issue persists even using the latest VS Code insiders build with all extensions disabled.

The intellisense is quick while Initializing JS/TS Language Features is loading.

2023-02-28 11-27-33

But after that, the issue begins. It takes 10 seconds for the code suggestion appear.

2023-02-28 11-25-08

necraidan commented 1 year ago

Hello ! I have the same behaviour, with TypeScript 4.9.5. With a previous major version of Typescript (like 4.8.*), the autocomplete was not so slow

accierro commented 1 year ago

Hi, I experience same issue. I started noticing it when VS code updated to 1.75.1, but even now with the latest version 1.76.0 I do have same issue.

I also noticed that if you downgrade Typescript version from 4.9.5 and reload TS server, it starts working as it should. I was downgrading to 4.9.4, but today since I have updated to VSCode 1.76.0 it doesn't work anymore.

mjbvz commented 1 year ago

@markcalendario Can you please share the project itself that causes this problem?

markcalendario commented 1 year ago

It's just a web project built in MERN Stack. The problem mostly occurs in server side (Express JS).

Here's the file structure.

Client Side image

Server Side image

Server Side's Dependencies "dependencies": { "bcrypt": "^5.0.1", "cors": "^2.8.5", "depcheck": "^1.4.2", "dotenv": "^10.0.0", "express": "^4.17.1", "express-status-monitor": "^1.3.4", "googleapis": "^89.0.0", "jsonwebtoken": "^8.5.1", "moment": "^2.29.1", "mongodb": "^4.1.0", "multer": "^1.4.3", "nodemailer": "^6.6.3", "nodemon": "^2.0.12", "validator": "^13.6.0" }

markcalendario commented 1 year ago

The issue is now fixed in 1.77.0.

ezgif com-video-to-gif