TypeScript: Auto imports (`getExportInfoMap`) extremely slow
Issue Type: Performance Issue
trying to use ctrl + space loading… for a period of time when I disabled it from builtin extensions the list is shown as expected
please vs-code team solve that problem because that builtin extension is so essential for us as a web developer best regards thanks.
VS Code version: Code 1.61.0 (ee8c7def80afc00dd6e593ef12f37756d8f504ea, 2021-10-07T18:13:09.652Z) OS version: Windows_NT x64 10.0.19043 Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel® Core™ i5-2430M CPU @ 2.40GHz (4 x 2395) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: unavailable_off opengl: enabled_on rasterization: unavailable_off skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: unavailable_off |
| Load (avg) | undefined |
| Memory (System) | 7.91GB (2.46GB free) |
| Process Argv | –crash-reporter-id d08f27d4-fc58-4cb3-87cf-fb19d0a2ef1e |
| Screen Reader | no |
| VM | 0% |
Process Info
CPU % Mem MB PID Process
0 79 9868 code main
0 87 3704 shared-process
0 67 4632 ptyHost
0 6 1120 console-window-host (Windows internal process)
0 48 9336 C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
0 5 1088 C:\WINDOWS\system32\cmd.exe /c ""C:\Program Files\nodejs\npm.cmd" start"
0 34 11440 "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" start
0 5 11568 electron_node app.js
0 28 11600 electron_node nodemon.js app.js
0 41 12692 "C:\Program Files\nodejs\node.exe" app.js
0 22 3772 crashpad-handler
0 186 5456 gpu-process
0 34 5736 utility
0 82 6732 window (Issue Reporter)
0 208 8128 window (auth.js - starter - Visual Studio Code)
0 61 1380 watcherService
0 143 5748 extensionHost
0 64 124 electron_node eslintServer.js
0 62 1504 electron_node serverMain.js
0 63 2688 electron_node server.js
0 624 4948 electron_node tsserver.js
0 70 6304 electron_node typingsInstaller.js typesMap.js
0 64 5700 electron_node server.js
0 74 7056 electron_node tsserver.js
0 70 10684 searchService
Workspace Info
| Window (auth.js - starter - Visual Studio Code)
| Folder (starter): 28 files
| File types: js(16) json(2) env(1) gitignore(1) MD(1)
| Conf files: package.json(1);
Extensions (77)
| Extension | Author (truncated) | Version |
|---|---|---|
| better-comments | aar | 2.1.0 |
| codesnap | adp | 1.3.4 |
| format-selection-as-html | adr | 2.3.0 |
| spaces-inside-braces | Air | 0.4.0 |
| Bookmarks | ale | 13.2.2 |
| copy-relative-path | ale | 0.0.2 |
| auto-add-brackets | ali | 0.12.0 |
| html-end-tag-labels | ant | 0.8.0 |
| generate-wt-scheme | bla | 0.0.5 |
| npm-intellisense | chr | 1.4.0 |
| path-intellisense | chr | 2.4.0 |
| bracket-pair-colorizer | Coe | 1.0.61 |
| bracket-pair-colorizer-2 | Coe | 0.2.1 |
| split-html-attributes | dan | 1.0.10 |
| vscode-markdownlint | Dav | 0.44.4 |
| vscode-eslint | dba | 2.2.1 |
| dotfiles-syntax-highlighting | dot | 0.1.0 |
| pug-formatter | duc | 0.6.0 |
| vscode-html-css | ecm | 1.10.2 |
| EditorConfig | Edi | 0.16.4 |
| vscode-npm-script | eg2 | 0.3.22 |
| magick-image-reader | ely | 0.5.0 |
| vsc-material-theme-icons | equ | 2.2.1 |
| prettier-vscode | esb | 9.0.0 |
| php-debug | fel | 1.19.0 |
| vscode-firefox-debug | fir | 2.9.4 |
| vscode-npm | fkn | 3.3.0 |
| auto-close-tag | for | 0.5.12 |
| auto-rename-tag | for | 0.1.8 |
| vscode-mysql | for | 0.4.1 |
| shell-format | fox | 7.1.1 |
| gc-excelviewer | Gra | 3.0.44 |
| output-colorizer | IBM | 0.1.2 |
| phpcs | ika | 1.0.5 |
| php-cs-fixer | jun | 0.2.8 |
| cmderrunner | jus | 0.1.2 |
| vscode-colorize | kam | 0.11.1 |
| vscode-gutter-preview | kis | 0.27.1 |
| node-module-intellisense | lei | 1.5.0 |
| rainbow-csv | mec | 1.9.1 |
| dotenv | mik | 1.0.1 |
| HTMLHint | mka | 0.10.0 |
| vscode-filesize | mkx | 3.1.0 |
| vscode-scss | mrm | 0.10.0 |
| python | ms- | 2021.10.1317843341 |
| vscode-pylance | ms- | 2021.10.0 |
| jupyter | ms- | 2021.9.1001312534 |
| jupyter-keymap | ms- | 1.0.0 |
| jupyter-renderers | ms- | 1.0.3 |
| live-server | ms- | 0.2.9 |
| vscode-typescript-next | ms- | 4.5.20211010 |
| vscode-typescript-tslint-plugin | ms- | 1.3.3 |
| debugger-for-chrome | msj | 4.13.0 |
| debugger-for-edge | msj | 1.0.15 |
| vscode-javascript-comment | Nic | 0.0.8 |
| vscode-javascript-snippet | Nic | 0.1.2 |
| vetur | oct | 0.34.1 |
| indent-rainbow | ode | 8.2.0 |
| vscode-html-scss | P-d | 0.0.42 |
| nested-comments | phi | 2.3.1 |
| csv-to-table | php | 1.3.0 |
| material-icon-theme | PKi | 4.10.0 |
| heroku-command | pko | 0.0.8 |
| polacode | pnp | 0.3.4 |
| vscode-css-peek | pra | 4.2.0 |
| LiveServer | rit | 5.6.1 |
| color-manager | roy | 0.6.3 |
| html5-boilerplate | sid | 1.1.1 |
| html-to-css-autocompletion | sol | 1.1.2 |
| sass-indented | syl | 1.8.18 |
| es6-string-html | Tob | 2.11.0 |
| remove-empty-lines | use | 0.0.8 |
| highlight-matching-tag | vin | 0.10.1 |
| vscodeintellicode | Vis | 1.2.14 |
| rainbow-tags | vol | 0.3.2 |
| material-theme | zhu | 3.13.2 |
| cmder-here | zyq | 0.0.2 |
(3 theme extensions excluded)
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
pythonvspyt639:30300192
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30358480
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
vsccppwt:30378364
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30371810
dockerwalkthru:30377721
bridge0723:30353136
pythonrunftest32:30373476
pythonf5test824:30373475
javagetstartedt:30364666
pythonvspyt187:30373474
pydsgst2:30361792
vsqsis200:30374795
vsaa593:30376534
vssld246:30379911
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 45 (11 by maintainers)
Commits related to this issue
- chore: Revert to typescript 4.4.4 until https://github.com/microsoft/TypeScript/issues/46735 is fixed — committed to xdy/xdy-pf2e-workbench by xdy 3 years ago
@moataz9 can you try disabling
TypeScript > Preferences: Include Package JSON Auto Importsand seeing how much that improves things?I have this issue and do not use mongoose. It’s been so slow the past couple of months that I’ve started typing everything out. Not much to contribute but didn’t want anyone caught up on mongoose specifically.
This is excellent repro information @atsikov and @kmoschcau. However, it’s a completely separate issue from the one reported by @moataz9, so I’ve forked your issue to #46948. If you have any further discussion, please continue it there. Let’s keep this issue specific to
getExportInfoMapbeing super slow as shown in the TS Server log (which I haven’t been able to repro but need to try more).@moataz9 hyy reinstalled nodejs and vs code worked
When I work on a small node project (using less than 4 packages) the suggestions list shown up normally. when I add more packages to use in that project, it leads the suggestions list doesn’t appear normally (loading … for a long period sometimes it take 2 min to show up and VS code in the task manager take more than normally in CPU measure as I mentioned previously )
here are the packages I use in my project
@andrewbranch turns out, it’s not only about vs code,
yarn tscis also incredibly slow. Not sure why I didn’t notice type checking issues after the upgrade on my main project.4.5.2created 30 times more (intermediate?) types and consumed 8 times more memory.TS 4.4.4 extended diagnostics
TS 4.5.2 extended diagnostics
I’m experiencing the same issue. With
4.5.2it takes 2 minutes to simply load a type hint on hover (Controllerfromreact-hook-formin this particular case). Our project is indeed huge, but the same operation with vs code’s built-in4.4.3is instant.I have no idea what’s happening under the hood, but these are the two things from the server log that look very slow in 4.52:
"command":"geterr"- almost two minutes until"event":"requestCompleted"against ~10ms for 4.4.344::encodedSemanticClassifications-full: elapsed time (in milliseconds) 109280.8950against less than 1s first time and less than 10ms later for 4.4.3Part of TS 4.5.2 server log
Same issue here. After 10-15min intellisense becomes unbearable and I have to keep restarting the editor. I have a fairly simple file with about 300 lines of code for a Babel plugin using @babel/core, but it eventually becomes slow regardless of the project.
I tried both on Linux and Windows and have the same exact issue on both OSs.
Facing the same problems on my node project. I found out that it works just fine before I install node_modules but after installing packages it becomes extremely slow. Here are the packages that i’m using
@moataz9 @mjbvz hello sir, I think Typescript intelligence causing delay because of mongoose