TypeScript: Autocomplete when typing is really slow.
Issue Type: Performance Issue
Autocomplete when typing is really slow. I have to wait for at least 5 seconds to see the suggestions.
VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:20:04.972Z) OS version: Darwin arm64 21.5.0 Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Apple M1 (8 x 24) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled |
| Load (avg) | 4, 4, 5 |
| Memory (System) | 16.00GB (0.14GB free) |
| Process Argv | . --crash-reporter-id 18c733b1-aae2-4bc9-b51e-cbe05d8afcd7 |
| Screen Reader | no |
| VM | 0% |
Process Info
CPU % Mem MB PID Process
15 164 1051 code main
6 82 1075 gpu-process
0 33 1077 utility-network-service
0 279 1079 window (index.vue — b2b-app)
29 147 1080 shared-process
0 49 1082 ptyHost
0 49 2188 npm run dev
0 1016 2204 node /Users/damiliner/damistack/workspace/b2b-app/node_modules/.bin/nuxt
0 262 2219 /opt/homebrew/Cellar/node@16/16.14.2/bin/node --max-old-space-size=2048 /Users/damiliner/damistack/workspace/b2b-app/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js
0 66 2220 /opt/homebrew/Cellar/node@16/16.14.2/bin/node --max-old-space-size=2048 /Users/damiliner/damistack/workspace/b2b-app/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js
0 0 3477 /opt/homebrew/bin/zsh -l
0 33 1084 fileWatcher
0 49 4619 fileWatcher
0 0 8956 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
0 328 1083 extensionHost
0 33 1088 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/formulahendry.auto-rename-tag-0.1.10/packages/server/dist/serverMain.js --node-ipc --clientProcessId=1083
0 49 1115 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/bradlc.vscode-tailwindcss-0.8.4/dist/tailwindServer.js --node-ipc --clientProcessId=1083
0 49 1118 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=1083
0 164 6359 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js --node-ipc --clientProcessId=1083
0 229 6368 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/octref.vetur-0.35.0/server/dist/vueServerMain.js --node-ipc --clientProcessId=1083
71 360 1548 window (NursingHomeController.js — api)
0 180 4618 extensionHost
0 98 4629 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node --max-old-space-size=3072 /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName /var/folders/rj/s5ftcl0n6bj3cj7h7j162kgc0000gn/T/vscode-typescript501/2764f4da0711c7e1050e/tscancellation-914ec9d01a6656410e83.tmp* --globalPlugins typescript-tslint-plugin,@vsintellicode/typescript-intellicode-plugin --pluginProbeLocations /Users/damiliner/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-1.3.4,/Users/damiliner/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.21 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
0 328 4630 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node --max-old-space-size=3072 /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/rj/s5ftcl0n6bj3cj7h7j162kgc0000gn/T/vscode-typescript501/2764f4da0711c7e1050e/tscancellation-85538ff4b124bd5c4a73.tmp* --globalPlugins typescript-tslint-plugin,@vsintellicode/typescript-intellicode-plugin --pluginProbeLocations /Users/damiliner/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-1.3.4,/Users/damiliner/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.21 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
0 49 4634 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js --globalTypingsCacheLocation /Users/damiliner/Library/Caches/typescript/4.6 --enableTelemetry --typesMapLocation /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typesMap.json --validateDefaultNpmLocation
0 49 4632 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/formulahendry.auto-rename-tag-0.1.10/packages/server/dist/serverMain.js --node-ipc --clientProcessId=4618
0 66 4639 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=4618
0 115 4667 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js --node-ipc --clientProcessId=4618
25 82 8954 issue-reporter
Workspace Info
| Window (NursingHomeController.js — api)
| Window (index.vue — b2b-app)
| Folder (api): 84 files
| File types: js(51) json(6) DS_Store(2) yaml(2) pem(2) env(1) example(1)
| backend(1) gitignore(1) md(1)
| Conf files: settings.json(1) package.json(1)
| Folder (b2b-app): 315 files
| File types: vue(107) js(52) ts(31) png(19) json(10) DS_Store(8) md(4)
| yml(3) html(3) yaml(3)
| Conf files: github-actions(1) settings.json(1) package.json(1)
| tsconfig.json(1);
Extensions (29)
| Extension | Author (truncated) | Version |
|---|---|---|
| better-comments | aar | 3.0.0 |
| project-manager | ale | 12.6.0 |
| copy-relative-path | ale | 0.0.2 |
| vscode-tailwindcss | bra | 0.8.4 |
| npm-intellisense | chr | 1.4.1 |
| path-intellisense | chr | 2.8.0 |
| vscode-eslint | dba | 2.2.2 |
| gitlens | eam | 12.0.6 |
| vscode-npm-script | eg2 | 0.3.25 |
| prettier-vscode | esb | 9.5.0 |
| auto-close-tag | for | 0.5.14 |
| auto-rename-tag | for | 0.1.10 |
| vscode-pull-request-github | Git | 0.42.0 |
| vscode-peacock | joh | 4.0.1 |
| vscode-docker | ms- | 1.22.0 |
| remote-containers | ms- | 0.234.0 |
| vscode-typescript-tslint-plugin | ms- | 1.3.4 |
| vetur | oct | 0.35.0 |
| vue-vscode-extensionpack | sdr | 0.2.0 |
| vue-vscode-snippets | sdr | 3.1.1 |
| vscode-fileutils | sle | 3.5.0 |
| vscode-status-bar-format-toggle | tom | 3.0.0 |
| vscodeintellicode | Vis | 1.2.21 |
| vscode-icons | vsc | 11.12.0 |
| quokka-vscode | Wal | 1.0.476 |
| vscode-import-cost | wix | 3.3.0 |
| vscode-jumpy | wma | 0.3.1 |
| JavaScriptSnippets | xab | 1.8.0 |
| markdown-all-in-one | yzh | 3.4.3 |
(1 theme extensions excluded)
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdc:30486549
See the image below.

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (10 by maintainers)
this could be related to incomplete tsconfig setup, or eslintrc. You need to add node_modules, and build artifacts into exclude sections of tsconfig, and eslintrc files. This way it will stop looking there, hence reduce the load on CPU.
Thanks. Based on the
package.json’s use of mongoose I suspect this is a duplicate of https://github.com/Automattic/mongoose/issues/10349Moving to TS to confirm this though
If you go back to that mongoose issue, you can see I’ve done some more investigation in the meantime… and for me v6 is slower 😅
Thank you @andrewbranch for the suggestion. I will look into that. I appreciate. To conclude, I downgraded my mongoose version to
"mongoose": "5.10.19",and everything is working fine. Hallelujah 🕺🏾