Skip to content

Language features extremely slow + >100% CPU usage #39284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tgroutars opened this issue Jun 26, 2020 · 10 comments
Closed

Language features extremely slow + >100% CPU usage #39284

tgroutars opened this issue Jun 26, 2020 · 10 comments

Comments

@tgroutars
Copy link

Issue Type: Performance Issue

VSCode is super slow to:

  • autocomplete
    Doesn't trigger automatically, and when pressing ctr+space, it take ages to load
  • autocomplete imports
    Seems almot impossible to autocomplete imports
  • report TS errors
    While I'm typing, VSCode takes a few seconds before updating the errors on the screen, it continues reporting errors where there were some before and doesn't show the new ones

CPU usage is also > 100% whenever I'm typing anything

VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:17:14.222Z)
OS version: Darwin x64 18.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 3, 2, 2
Memory (System) 16.00GB (2.01GB free)
Process Argv --disable-extensions Maze.code-workspace
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
   13	   115	 35505	code main
   10	    66	 35538	   gpu-process
    0	    33	 35540	   utility
   67	   311	 35541	   window (index.ts — Maze (Workspace))
    7	    98	 35544	     extensionHost
    0	    82	 35815	       electron_node tsserver.js 
  102	   393	 35816	       electron_node tsserver.js 
    0	    82	 35840	         electron_node typingsInstaller.js typesMap.js 
    0	    49	 36111	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=35544
    0	     0	 35545	     zsh -l
    0	    33	 35554	     watcherService
    0	    49	 36363	     searchService
   11	   115	 36011	   shared-process
    0	     0	 36396	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
   30	    66	 36390	   window (Issue Reporter)
Workspace Info
|  Window (index.ts — Maze (Workspace))
|    Folder (edge): 10 files
|      File types: json(4) gitignore(1) yml(1) js(1) lock(1)
|      Conf files: package.json(1)
|    Folder (recording): 24 files
|      File types: js(8) json(3) babelrc(1) editorconfig(1) gitignore(1)
|                  npmignore(1) nvmrc(1) prettierrc(1) md(1) yml(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (notifier): 26 files
|      File types: js(10) json(2) babelrc(1) editorconfig(1) gitignore(1)
|                  npmignore(1) nvmrc(1) prettierrc(1) md(1) yml(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (referral_service): 26 files
|      File types: js(10) json(2) babelrc(1) editorconfig(1) gitignore(1)
|                  npmignore(1) nvmrc(1) prettierrc(1) md(1) yml(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (order_testers): 28 files
|      File types: js(9) json(4) babelrc(1) editorconfig(1) gitignore(1)
|                  nvmrc(1) prettierrc(1) yml(1) snap(1) lock(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (utils): 43 files
|      File types: js(15) json(6) md(2) babelrc(1) editorconfig(1)
|                  gitignore(1) npmignore(1) nvmrc(1) prettierrc(1)
|                  gitkeep(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (page_service): 37 files
|      File types: js(11) json(2) babelrc(1) dockerignore(1) editorconfig(1)
|                  gitignore(1) npmignore(1) npmrc(1) nvmrc(1)
|                  prettierrc(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (project_service): 123 files
|      File types: js(74) json(9) zip(9) babelrc(1) editorconfig(1)
|                  gitignore(1) npmignore(1) nvmrc(1) prettierrc(1) md(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (sl-api): 109 files
|      File types: js(60) md(2) json(2) babelrc(1) editorconfig(1)
|                  gitignore(1) npmignore(1) nvmrc(1) prettierrc(1)
|                  yml(1)
|      Conf files: package.json(1) webpack.config.js(1)
|    Folder (maze-api-core): 288 files
|      File types: js(183) json(5) babelrc(1) yml(1) editorconfig(1)
|                  eslintignore(1) eslintrc(1) gitignore(1) jshintrc(1)
|                  npmignore(1)
|      Conf files: jsconfig.json(1) package.json(1)
|    Folder (maze-api): 356 files
|      File types: js(210) id(15) db(7) config(6) json(4) yml(2) names(2)
|                  lock(2) babelrc(1) editorconfig(1)
|      Conf files: jsconfig.json(1) package.json(1)
|    Folder (maze-dashboard): 373 files
|      File types: js(246) png(4) json(3) scss(3) yml(1) env(1) gitignore(1)
|                  npmrc(1) nvmrc(1) md(1)
|      Conf files: jsconfig.json(1) package.json(1)
|    Folder (maze-components): 1274 files
|      File types: js(451) svg(246) json(88) snap(73) mdx(68) DS_Store(3)
|                  html(3) babelrc(2) eslintrc(2) md(2)
|      Conf files: package.json(2) webpack.config.js(1)
|    Folder (maze-webapp): 3908 files
|      File types: js(2132) png(187) json(151) svg(105) jpg(45) scss(29)
|                  mp4(21) ts(18) gif(12) snap(7)
|      Conf files: github-actions(1) settings.json(1) jsconfig.json(1)
|                  package.json(1) tsconfig.json(1);
Extensions disabled
@tgroutars tgroutars changed the title Language features extremely slow Language features extremely slow + >100% CPU usage Jun 26, 2020
@ddoe8
Copy link

ddoe8 commented Jun 26, 2020

Having the same issues for a few days after doing the latest update. Autocomplete not loading and organizing imports on save. Have no idea what could be behind the it.

@tgroutars
Copy link
Author

It also started happening to me after the last update, but weirdly enough downgrading didn't solve the issue for me

@tgroutars
Copy link
Author

I uninstalled and reinstalled @types/ramda from my project and the issue seems to have solved itslef 🤷‍♂️ I'll close the issue as it doesn't seem to be relevant anymore

@tgroutars tgroutars reopened this Jun 26, 2020
@tgroutars
Copy link
Author

Nope, nevermind 🙈

@mjbvz mjbvz transferred this issue from microsoft/vscode Jun 26, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Jun 26, 2020

@tgroutars Can you please share a project that triggers the high cpu usage?

@mjbvz mjbvz removed their assignment Jun 26, 2020
@tgroutars
Copy link
Author

Continued investigating and I actually think the @types/ramda package was causing the issue. After removing it for good, I can't reproduce this issue anymore

@aecorredor
Copy link

@tgroutars are you just not using types for ramda now? or did you switch to some other types package?

@tgroutars
Copy link
Author

@tgroutars are you just not using types for ramda now? or did you switch to some other types package?

I removed it for now and just added an empty declaration in a custom types file.

We're incrementally migrating our codebase to TypeScript right now. We have lots of code using ramda already, and apart from making vscode slow, the types are also incorrect in some places.

We're looking into migrating to an alternative such as rambda or more remeda.

The advantage of rambda is it's almost a drop in replacement, but remeda is designed to work well with TypeScript, so not sure which path we'll take yet

@guillaumep
Copy link

Having the same issue here, since last upgrade. Removing rambda's typing is not an option in our case.

Can we reopen this issue?

@tgroutars
Copy link
Author

I might be mistaken but my understanding is that @types/ramda uses recursive types, which makes the static analysis of ramda code very slow.
It might be worth for the TS team to investigate, but then they'd probably rather work with a minimal example using a pattern that's causing the problem, so you might have more luck opening a new issue instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants