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 draws are taking very long on some environments #36913

Closed
ghost opened this issue Oct 25, 2017 · 39 comments
Closed

Terminal draws are taking very long on some environments #36913

ghost opened this issue Oct 25, 2017 · 39 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron terminal General terminal issues that don't fall under another label upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@ghost
Copy link

ghost commented Oct 25, 2017

  • VSCode Version: Code 1.17.2 (b813d12, 2017-10-16T13:59:48.528Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author (truncated) Version
vscode-devdocs akf 1.0.1
project-manager ale 0.22.0
vscode-intelephense-client bme 0.7.2
npm-intellisense chr 1.3.0
laravel-goto-view cod 1.1.2
bracket-pair-colorizer Coe 0.10.10
gitlens eam 5.7.1
php-debug fel 1.11.1
auto-close-tag for 0.5.2
auto-rename-tag for 0.0.14
vscode-import-formatter hen 0.1.8
composer ika 0.5.0
vscode-php-snippets jar 0.0.9
php-namespace-resolver Meh 0.8.0
code-beautifier mic 1.7.2
vscode-todo-parser min 1.9.1
vs-deploy mkl 10.0.0
azure-account ms- 0.1.3
php-docblocker nei 1.3.2
laravel-blade one 1.9.0
laravel5-snippets one 1.3.4
vscode-docker Pet 0.0.20
material-icon-theme PKi 2.2.3
gi rub 0.2.11
laravel-artisan rya 0.0.8
highlight-matching-tag vin 0.4.4
vscode-wakatime Wak 1.1.18
vscode-todo-highlight way 0.5.11
vscode-import-cost wix 2.5.1

(1 theme extensions excluded)


Steps to Reproduce:

  1. Hit the carat to maximize the terminal

maximizeterminal

  1. VSCode then becomes very slow.

Reproduces without extensions: (disabling extensions improves performance, but it is still "slow")

@dbaeumer dbaeumer added the terminal General terminal issues that don't fall under another label label Oct 25, 2017
@Tyriar
Copy link
Member

Tyriar commented Oct 28, 2017

@jm-mwi what's in your settings.json file? Do you have a particularly small font size and/or window.zoomLevel?

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Oct 28, 2017
@eterevsky
Copy link

eterevsky commented Oct 28, 2017

@Tyriar, I also ran into the same problem. It seems to have started only in 1.17, though it might have resulted from some unrelated changes in my configuration.

Version: 1.17.2
Relevant settings:

{
  "editor.fontFamily": "Fira Code Retina",
  "editor.fontLigatures": true,
  "editor.fontSize": 15,
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
  "window.zoomLevel": 0,
  "workbench.activityBar.visible": false,
}

My monitor resolution is 3840x2160 and system-wide scaling is 150%.

Reproduction steps:

  1. Disable all the extensions and close all editor tabs.
  2. Maximize the window by pressing F11.
  3. Open terminal and maximize its pane.
  4. Run cat some_file.txt to fill up 200-500 lines on the terminal.
  5. At this point most actions in the Terminal are extremely slow, in particular:
    • Typed letters appear with a noticeable delay.
    • Scrolling the terminal window with a mouse wheel hangs the system. None of vscode UI is responsible, the mouse pointer moves in jerks, "The window is no longer responsible" system alert may or may not appear. Pressing Ctrl-Alt-Del to open Task Manager works with a delay of several seconds.

In Task Manager I see that VSCode process taking ~1 CPU core and System process taking from 1 to 2 cores.

I also ran into a similar though less severe issue on Linux, with the similar settings of VSCode, and monitor 2560x1600.

@eterevsky
Copy link

A couple of additional observations:

  • Changing the font to less exotic Consolas does not fix the problem. (Though it might help a bit.)

  • For some reasons the slowness is also triggered by actions like hitting the TAB key for bash completion, even though it doesn't have any visible effect in the terminal. Hitting the TAB key in the same context in the system terminal doesn't result in slowness.

@Tyriar
Copy link
Member

Tyriar commented Oct 29, 2017

@eterevsky do you know if GPU acceleration is disabled somehow? For example do you use --disable-gpu to work around some other issue?

@eterevsky
Copy link

@Tyriar, no I haven't disabled GPU acceleration.

Attaching a screenshot of the profiler in Developer Tool.

vscode-screenshot

@ghost
Copy link
Author

ghost commented Oct 30, 2017

@Tyriar, here are my settings as it relates to text...

{
    "workbench.iconTheme": "material-icon-theme",
    "editor.lineHeight": 24,
    "editor.fontSize": 15,
    "editor.fontFamily": "Hasklig, Monoid, Fira Code",
    "editor.fontLigatures": true,
    "editor.minimap.enabled": true,
    "editor.minimap.maxColumn": 200,
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "editor.minimap.showSlider": "always",
    "window.zoomLevel": 1,
    "editor.minimap.renderCharacters": false
}

@Tyriar
Copy link
Member

Tyriar commented Oct 30, 2017

@eterevsky thanks for the screenshot 😃 something about your environment is drawing from ImageBitmaps very slowly. What OS/version are you on?

@eterevsky
Copy link

@Tyriar It's an up-to-date 64-bit Windows 10. VSCode version: 1.17.2. Later today I can try to connect a Macbook to a 4K monitor, to see whether it's reproducible on another OS.

I don't experience any slowness in the editor panes, it's specific to the terminal.

@Tyriar Tyriar changed the title Terminal hangs/becomes slow when "maximizing" the size Terminal draws are taking very long on some environments Oct 30, 2017
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Oct 30, 2017
@Tyriar Tyriar added this to the Backlog milestone Oct 30, 2017
@Tyriar
Copy link
Member

Tyriar commented Oct 30, 2017

All related reports for this problem seem to be on Windows 10.

@eterevsky
Copy link

All related reports for this problem seem to be on Windows 10.

Yep. Tried to reproduce on macOS, but everything worked smoothly.

If you point me to a 1.16 installer, I can check, whether it's a new bug in 1.17.

@Tyriar
Copy link
Member

Tyriar commented Oct 30, 2017

@eterevsky no need, it's new with these changes: https://code.visualstudio.com/blogs/2017/10/03/terminal-renderer

@franklin-ross
Copy link

Just dropping my 2 cents in here to say I seem to have the same issue. I've got a couple of Webpack builds, and one of them seems to cause this reasonably often. Everything locks up for a few seconds, on and off, especially when scrolling. I too am running windows 10 64-bit with VSCode 1.17.2.

I profiled while it was happening. Here's a lil' screenshot of what I guess is causing it, and I can provide the profiler file too, but it's a cool 33meg.

image

@franklin-ross
Copy link

I've noticed this only seems to happen on my high DPI laptop. If VSCode is open on the same laptop, but displaying on a 1920x1080 screen, I no longer seem to have any issues.

@eterevsky
Copy link

Hi! Is there any update on this issue? For me it makes VSCode terminal completely unusable in my preferred workflow, and I have to use external terminals, even though I really like the idea of a console in a VSCode pane.

@Tyriar
Copy link
Member

Tyriar commented Jan 21, 2018

@eterevsky I'm still not sure what the root cause is unfortunately.

I have had reports of slow drawing when the terminal has certain styling, particularly when most of the terminal has a different background color or is using true color. Is anyone's terminal doing this during the slow down? (see vercel/hyper#2592)

@zeroepoch
Copy link

I'm using Ubuntu 16.04 x86_64 and I'm seeing the same problem with 1.20.1. I also have a 4k HiDPI display with 125% font scaling. Done by the DE for the menus and stuff. Other font sizes (maybe due to another bugs) is done for the terminal and editor through prefs.

"editor.fontFamily": "Inconsolata",
"editor.fontSize": 15,
"terminal.integrated.fontSize": 15,

When the terminal windows is not maximized it works perfectly fine. If I un-maximize it performance returns to normal. I can toggle back and forth between maximized and normal and the perf issue comes and goes between states as described.

@anovix
Copy link

anovix commented Feb 17, 2018

Same for me as for @zeroepoch . I am on Ubuntu 17.10. Desktop gnome 3.26.2. VSCode 1.20.1. Terminal becomes very slow when I maximaze it. After I unmaximzed it is working perfectly. My laptop display has 4k resolution (3840x2160) and at 200% scale. Hope my info helps.

@eterevsky
Copy link

@Tyriar Exactly the same issue happens on Linux. VSCode 1.21. Here's a screenshot of the profiler:

screenshot from 2018-03-14 15-08-13

It's a pity, since I really like VSCode terminal, and this bug makes it unusable for me both on Windows and on Linux.

@Tyriar
Copy link
Member

Tyriar commented Mar 15, 2018

@eterevsky do you experience the issue on the same machine on Windows/Linux with dual booting by chance? Can you provide details on your GPU?

@eterevsky
Copy link

@Tyriar Those are two different computers. The Windows machine has nVidia GTX 1080, the Linux machine has nVidia Quadro K620.

@Tyriar
Copy link
Member

Tyriar commented Mar 16, 2018

@eterevsky and you're not setting --disable-gpu when you launch code right?

@eterevsky
Copy link

@Tyriar Nope, I do not pass any special options. You actually already asked that here :)

@Tyriar
Copy link
Member

Tyriar commented Mar 22, 2018

@eterevsky opps, too many notifications 😛.

Could you try reproduce when launching with this?

code --ignore-gpu-blacklist --enable-accelerated-2d-canvas --enable-gpu-rasterization --enable-native-gpu-memory-buffers

@eterevsky
Copy link

@Tyriar Sorry for the delay. I tried it on my Linux machine, and it worked in exactly the same way as before, i.e. very slow.

It's also reproducible when the terminal is split (a new VSCode feature). It's also reproducible when the window is not completely maximized, but still fills most of the screen.

It does not happen when the terminal covers less than ~1/3 or ~1/4 of the screen space. If seems that there is a certain threshold of the number of characters or pixels: while the terminal is below this threshold it works completely fine, and once past this threshold it chokes for seconds after each character or line.

@franklin-ross
Copy link

Just want to chime in again to say that @eterevsky s comments are very consistent with my experience on windows too. There does seem to be a threshold at about a quarter or third of the screen space were the issue first appears, and it mostly only presents on my high DPI screen so my guess is it's more about pixels them characters. It also doesn't seem as bad if the side bar is open, which one again reduces the actual screen space being drawn to by the terminal.

I tried to reproduce the issue in the xtermjs demo on Chrome the other day to see whether it would also choke when drawing lots of characters in a large terminal; but I couldn't seem to get it to maximise properly, even with their full screen plugin. It looked full screen, but would only actually draw characters to the same small section. I could have another go if that seems like it could be helpful, or if someone with more experience with xterm could help me set up in a similar way to how vscode uses it.

@Tyriar
Copy link
Member

Tyriar commented Mar 27, 2018

@franklin-ross in the xterm.js demo you can increase the size of the viewport by setting the cols and rows in the textboxes at the bottom.

@franklin-ross
Copy link

I see. Thanks @Tyriar, I'll give it another go this long weekend and see what comes out of it.

@Tyriar
Copy link
Member

Tyriar commented Mar 29, 2018

I created #46954 to provide a fallback when canvas GPU acceleration is turned off.

@dkent600
Copy link

dkent600 commented Apr 4, 2018

When running as code --disable-gpu the problem for me goes away. I have a 4K monitor.

@Tyriar
Copy link
Member

Tyriar commented Apr 4, 2018

I was able to repro by stretching across 2 1080p monitors and maximizing the panel

image

image

It's very interesting that the experience is much better with GPU support disabled.

image

@Tyriar
Copy link
Member

Tyriar commented Apr 4, 2018

Ok I have some good news, I cannot reproduce this slowness on our build that's on Electron v2/Windows 10 which will likely hit stable in v1.23. It would be great if I could get some people to verify those who have been experiencing the issue. Here's the build https://az764295.vo.msecnd.net/exploration/3ff48e575e04e31a0e4645656c18f43047444bad/VSCode-win32-x64-1.23.0-exploration.zip

Something else that puts more weird behind this thinking is that I can't reproduce the slowness when I run the terminal under Chrome 65.

@Tyriar Tyriar added the electron Issues and items related to Electron label Apr 4, 2018
@dkent600
Copy link

dkent600 commented Apr 4, 2018

@Tyriar That exploration build does not exhibit the problem, works fine for me.

@eterevsky
Copy link

@Tyriar Great! The new build works fine for me as well, even scrolling is pretty smooth.

Thanks!

@Tyriar
Copy link
Member

Tyriar commented Apr 4, 2018

@dkent600 @eterevsky awesome! I'll close this off then for the April release. There are some more performance improvements to come, but I'm glad this issue is solved.

@Tyriar Tyriar closed this as completed Apr 4, 2018
@Tyriar Tyriar modified the milestones: Backlog, April 2018 Apr 4, 2018
@rebornix rebornix added the verified Verification succeeded label Apr 25, 2018
@eterevsky
Copy link

@Tyriar I just installed version 1.23.0, and the issue is still present. Could you tell me, in which release is it expected to be fixed?

@Tyriar
Copy link
Member

Tyriar commented May 11, 2018

@eterevsky It's being improved when we bring in Electron 2 which was pushed out from April (will probably be June). I'm not tracking this class of issues in #46954

@johndevedu
Copy link

@eterevsky If you get the Insiders edition, I'm pretty sure the problem is gone.

@S-t-e-p-s
Copy link

This happened to me on my laptop (4K screen size) where I turned off external GPU unit and instead was using integrated intel gpu. Terminal was consumig a lot of integrated GPU power thus whole IDE was hanging. Switching to insiders edition didn't help for the same reason.
Running IDE with: code --disable-gpu resolved the issue. I updated shortcut to run with this parameter - so far everything works fine.
I'm using Window 10 laptop with integrated GPU unit.

@vscodebot vscodebot bot locked and limited conversation to collaborators May 19, 2018
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 electron Issues and items related to Electron terminal General terminal issues that don't fall under another label upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests