VSCode incredibly slow, 100% CPU usage, coming from electron_node tsserver.js CPU usage #40138
Description
- VSCode Version: 1.48.0
- OS Version: iOS Catalina 10.15.5
Steps Attempted to Resolve issue:
- Disable all extensions except typescript/javascript features
- Install JS and TS Nightly extension as recommended
- Downgrading to previous version of VSCode (1.32.0)
- Installing latest VSCode Insiders
- Increased max memory allowed by typescript server
- Check to make sure no extension takes more than 100ms to load
Additional Info
The project is 200k lines and smaller projects do not have the issue. Its primarily related to typescript because if I disable the built-in javascript/typescript features then the tsserver doesn't spin up, so no problem.
- The hovering types are almost always at "loading..." state.
- Cmd Clicking into types to see what they are is also insanely slow and practically unusable
- Autocomplete is incredibly slow, and often nonexistent, even for basic commands like 'clo' for console.logs
- Red error lines from intellisense are 2-5min lagging behind my actual changes. its like vscode is hung up
If I open the project freshly, find an object, and change a variable to gibberish, then it will take several minutes for VSCode to complain to me with intellisense. Simply saving, and running the app in the browser with auto-reload is faster because chrome will show me compile errors
Below is the result of running ps aux | grep [number]
:
jfarris 90151 100.8 1.6 7160436 550880 ?? R 9:30AM 9:16.20 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) --max-old-space-size=8072 /Users/jfarris/Documents/amaro-ui/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --enableTelemetry --cancellationPipeName /var/folders/mg/97w2bx6d1fqdkyd9bmyh6sd00000gp/T/vscode-typescript502/31ba41063dba52b8428d/tscancellation-0b463b00b389646856b1.tmp* --globalPlugins typescript-vscode-sh-plugin --pluginProbeLocations /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation
jfarris 92342 0.0 0.0 4408572 816 s002 S+ 9:40AM 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox 90151
Below is the process explorer - notice the tsserver.js using more than 100%. This happens when turning on VSCode > it then slows down to normal number > then i start editing in VSCode and it jumps back up > it stays up for 2-3min AFTER I've stopped editing > then finally slows down. But sometimes it just stays at 100 even 5+ min after I've finished editing
Below is the CPU usage from the activity monitor
Does this issue occur when all extensions are disabled?: Yes/No
Activity