Skip to content
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

Terminal canvas renderer can be slow sometimes #72538

Closed
dzg opened this issue Apr 18, 2019 · 10 comments
Closed

Terminal canvas renderer can be slow sometimes #72538

dzg opened this issue Apr 18, 2019 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) perf terminal General terminal issues that don't fall under another label

Comments

@dzg
Copy link

dzg commented Apr 18, 2019

Issue Type: Performance Issue

Since a few days ago VS Code is EXTREMELY sluggish, to the point of not being useable.
I tried disabling ALL extensions (except builtin) but did not help.
I also deleted all support files/folders in ~/Library. Did not help.

This is even with just 1 single editor open.

Help!!!
UPDATE After some testing, it seems to happen when I open a terminal panel in VS Code. If I close the terminal panel, it returns to normal speed.

VS Code version: Code 1.33.1 (51b0b28, 2019-04-11T08:22:55.268Z)
OS version: Darwin x64 15.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 x 4000)
GPU Status 2d_canvas: unavailable_software
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: unavailable_off
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 4, 4
Memory (System) 32.00GB (14.88GB free)
Process Argv
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
   14	    98	  2545	code main
    0	    66	  2546	   gpu-process
    0	   492	  2547	   window (fox-server2.js — portal (Workspace))
    0	     0	  2573	     /bin/bash -l
    0	    98	  2601	     extensionHost
    0	   131	  2608	       electron_node tsserver.js 
    0	    66	  2621	         electron_node typingsInstaller.js typesMap.js 
    0	    66	  2665	       /Users/dang/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/dang/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/jsonServerMain --node-ipc --clientProcessId=2601
    0	    33	  2602	     watcherService
    0	    33	  2692	     /Users/dang/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/dang/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork ms-vscode.node2 {"common.vscodemachineid":"18c4dcf0f0ffbc117ed7b3bcba62025922b56fc996bd3556cbaacb019f69358e","common.vscodesessionid":"7689dc4a-a274-4861-b55f-447b3bedd3e21555577571247"} AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217
    0	    66	  2618	   shared-process
    0	    98	  2802	   window (Issue Reporter)
    0	     0	  2806	   /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
Workspace Info
|  Window (fox-server2.js — portal (Workspace))
|    Folder (portal): 3033 files
|      File types: js(2382) html(401) css(94) png(52) json(51) DS_Store(24)
|                  jsx(9) vue(6) txt(4) gitignore(2)
|      Conf files: package.json(3) launch.json(1);
Extensions: none
@dzg dzg changed the title Suddenly slow (Mac) Extremely sluggish when using Terminal panel (Mac) Apr 18, 2019
@Antisunny
Copy link

Have you compare the loading speed of native Terminal.app and VScode Terminal panel?

@dzg
Copy link
Author

dzg commented Apr 23, 2019

Have you compare the loading speed of native Terminal.app and VScode Terminal panel?

Yes, normal Terminal is "normal" speed. If I close the terminal panel, VSC returns to normal speed.

Note that it's not just the terminal panel in VSC that is slow ... it's the entire app, including any editor panels.

I noticed same behavior on 3 separate machines.

@koenpunt
Copy link

I see extreme slowness without having a terminal panel open. For now I downgraded to 1.32.3, and disabled auto update to make VSCode usable again.

@Tyriar
Copy link
Member

Tyriar commented Apr 24, 2019

@dzg does this setting fix the problem?

"terminal.integrated.rendererType": "dom"

See https://github.com/Microsoft/vscode/wiki/Performance-Issues for diagnosing performance issues.

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Apr 24, 2019
@dzg
Copy link
Author

dzg commented Apr 24, 2019

@dzg does this setting fix the problem?

"terminal.integrated.rendererType": "dom"

Yes, seems that it does! Thanks!

@Tyriar Tyriar changed the title Extremely sluggish when using Terminal panel (Mac) Terminal canvas renderer can be slow sometimes Apr 29, 2019
@Tyriar Tyriar added terminal General terminal issues that don't fall under another label perf bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Apr 29, 2019
@Tyriar
Copy link
Member

Tyriar commented Apr 29, 2019

You're probably hitting one of the issues that the canvas renderer just can't handle very well, such as:

  • GPU doesn't like rendering Chromium's canvas
  • Chromium disables GPU acceleration
  • The terminal renders lots of colors, particularly in background
  • The terminal renders lots of non-ascii characters

The workaround for this is to use the DOM renderer, which typically will degrade performance in some focuses cases, but it should have better overall performance:

"terminal.integrated.rendererType": "dom"

The end fix here is to bring xterm.js' WebGL renderer into VS Code xtermjs/xterm.js#2033

@clankill3r
Copy link

clankill3r commented Aug 4, 2019

Even when I set it to dom it is still unbearable slow. (this is with colors etc.).
I estimate around 10fps.

This is what scrolling in 1987 looked like:
https://www.youtube.com/watch?v=L41oIvre9K0

@Tyriar
Copy link
Member

Tyriar commented Aug 7, 2019

@clankill3r the DOM being too slow for a huge highly dynamic buffer is exactly why I pursued the canvas implementation, but there are issues with a 2d rendering context that we simply cannot overcome without going lower level which is why I put together the WebGL renderer.

Since your hardware seems to have issues with both, you can try it out if you want and let me know if it solves the perf issue. To try it out clone the xterm.js repo, launch the demo and hit the Enable WebGL Renderer button down the bottom: https://github.com/xtermjs/xterm.js/wiki/Contributing#linux-or-macos

@Tyriar
Copy link
Member

Tyriar commented Oct 9, 2019

This isn't actionable outside of electron updates improving GPU support, new hardware or xtermjs/xterm.js#2033

@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) perf terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

5 participants