TypeScript: VSCode TypeScript types-registry Performance Bug
Type: Performance Issue
VSCode TypeScript keeps running npm install types-registry@latest
wether the window is opened or even closed! This process makes 100% CPU all the time on my MacBook Pro M1 Pro 14" 2021. This makes my Mac runs hotter, and drains the battery so much. Please fix this.
VS Code version: Code 1.76.1 (5e805b79fcb6ba4c2d23712967df89a089da575b, 2023-03-08T16:48:08.231Z) OS version: Darwin arm64 22.3.0 Modes: Sandboxed: No
System Info
Item | Value |
---|---|
CPUs | Apple M1 Pro (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 opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
Load (avg) | 4, 4, 4 |
Memory (System) | 16.00GB (1.57GB free) |
Process Argv | . --crash-reporter-id 36f047c5-4fb0-47f5-b14f-86c1a3245f56 |
Screen Reader | yes |
VM | 0% |
Process Info
CPU % Mem MB PID Process
29 180 5581 code main
10 82 5584 gpu-process
0 33 5585 utility-network-service
68 393 5587 window (index.jsx — agallio.xyz)
30 180 5588 shared-process
0 66 5590 ptyHost
0 66 5593 fileWatcher
0 0 5678 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
0 180 5589 utility-process
0 147 5592 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --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/_w/8g5fd_tn1ks7cklkr_c6t_t80000gn/T/vscode-typescript501/b7be7f9d6170981475a5/tscancellation-85b4d4295cb860a931aa.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc)
0 328 5594 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --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/_w/8g5fd_tn1ks7cklkr_c6t_t80000gn/T/vscode-typescript501/b7be7f9d6170981475a5/tscancellation-d4ab4655c236db7fec79.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc)
0 98 5608 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js --globalTypingsCacheLocation /Users/agalliosamai/Library/Caches/typescript/4.9 --enableTelemetry --typesMapLocation /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typesMap.json --validateDefaultNpmLocation)
0 147 5610 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/agalliosamai/.vscode/extensions/dbaeumer.vscode-eslint-2.4.0/server/out/eslintServer.js --node-ipc --clientProcessId=5589)
0 49 5637 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --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=5589)
22 82 5676 issue-reporter
Workspace Info
| Window (index.jsx — agallio.xyz)
| Folder (agallio.xyz): 1154 files
| File types: js(509) json(313) css(73) svg(31) pack(20) jsx(20)
| woff2(12) sql(11) png(11) webp(9)
| Conf files: package.json(3) dockerfile(2) jsconfig.json(2)
| settings.json(1);
Extensions (3)
Extension | Author (truncated) | Version |
---|---|---|
vscode-eslint | dba | 2.4.0 |
gitlens | eam | 13.3.2 |
prettier-vscode | esb | 9.10.4 |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewvextcfv2:30681851
azure-dev_surveyone:30548225
pyindex848:30662994
nodejswelcome1:30587005
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
vsccsb:30677849
funwalk2:30682974
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 23 (11 by maintainers)
I think I found the culprit. The TS caches inside the
~/Library/Caches/typescript
are broken. I delete them and open VSCode again, and it can re-install the types-registry without hanging. It seems like it’s because the last VSCode version I used (can’t remember the exact version number) doesn’t install the types-registry withnpm
directly (IIRC though, CMIIW).