-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Integrated terminal poor performance on WSL 2 (laggy) #100427
Comments
There is a know problem with speed here: #74620, if it's rendering being slow you could try using the setting /duplicate |
@Tyriar I will try that, thanks |
@Tyriar switching to |
The VSCode terminal is also running slow for me in the WSL2 terminal. |
Can you open dev tools (Help > Toggle Developer Tools), and do a performance profile (Performance tab, hit record button) of the lagginess, save and upload that here? |
@Tyriar I didn't see anything obvious between each profile, but there is a lag on the WSL one, for example, just typing my name feels slower than the native (powershell) version |
This one is more interesting, it looks like the WSL version generates less frames than the windows version, maybe this could be contributing to the laggy feel |
So from those profiles everything seems to be working fine, the WSL ones even seem better as expected as they're not being routed through pty emulation (conpty). If it's purely input latency that wouldn't show up in the profiles, my only explanation for what you're seeing is that the communication bridge between Windows and WSL2 on your machine is slower than normal which would slow the entirety of VS Code. Not sure what I can do about this unless I can repro it unfortunately and I use a WSL2 remote every day and it's always been faster than in Windows. |
@Tyriar i was also surprised by the performance output. I agree i think maybe its an input latency issue with the communication bridge, are there any tools for debugging this (or even confirming that's the case)? interestingly enough i don't find the whole of VSCode slow (maybe it is slower and i haven't noticed) just when I type in the integrated terminal |
@jasonwilliams if my theory is true, the same latency would happen when you open or save a file, not when you type in the editor though. I'd think such latency would be much harder to perceive though than keystroke to character on screen. I don't know of any way to debug this, maybe @aeschli might know? |
Aside: Windows Terminal seems ok and faster than the integrated terminal in VSCode, so I'm not sure if its a "Windows OS" issue. Opening and closing files is pretty fast (if that helps) |
pings @aeschli |
Maybe run it out of sources and add log statements? I would check if it reproduces with the TestResolver. Otherwise you need WSL out-of-sources setup (setup is described on our (internal) remote wiki (@Tyriar can access)) |
What’s the testResolver? And what’s the out of sources setup? @Tyriar does this make sense to you? |
Below two screen-captures that hopefully demonstrate what @jasonwilliams is describing: Captured on the same machine, same installation of VS Code (1.48.0 – same extensions enabled). The only difference is that one is running "direct" and the other via the Remote-WSL extension. Had my password manager type out the text; animated GIF captured at 60 FPS. The captures don't fully do it justice ("in person" it feels much worse), but I hope it helps to get "the picture" across... 🙂
All seems to point to some kind of issue in the connection between VS Code and the "remote" WSL? I'm using WSL2 quite actively for other stuff and haven't noticed any strange behaviour when interacting with it directly (through Windows Terminal) or while using Docker to, for example, run test-suites. Recently got a new laptop, so I'm not sure if it's related to a specific version of VS Code, something I did with my Windows-installation or something specific to the hardware of this device... |
Ahh @thijsputman thank you very much for that, I’m glad it’s not just me going mad. I tried to find a way to show this but couldn’t so I’m happy you’ve done that. @Tyriar @aeschli what @thijsputman is describing is what I experience also, and as he’s said the comparison gifs don’t do it justice. |
My pleasure! Had been blaming my video card driver for the sluggishness (and was thus on a wild goose chase attempting to resolve that issue). Very happy to come across your bug report. Just set up a clean copy of Ubuntu on WSL2 and that exhibits the same issue. It doesn't appear to be caused by any specific modifications made inside the WSL2 distro... |
Ran a couple more tests: Connecting to WSL2 via SSH exhibits the same issue; using SSH to connect to another device (a Raspberry Pi on the local network) appears laggy too. Interestingly, the problems seems to be purely input-related: Observing the output of |
Looks like it was raised before microsoft/vscode-remote-release#1732 but it didn't go anywhere |
@Tyriar @bpasero are you able to help us with this? or copy over the internal wiki details? |
I'm not sure if this is the location the terminal is used, but it could be worth logging here and building from source. vscode/src/vs/workbench/contrib/terminal/node/terminalProcess.ts Lines 231 to 237 in f74e473
|
I am also facing the same issue. Moreover, I have found that the terminal lags significantly on certain outputs. Example: |
I’m affected by this aswell. It’s only slow when in WSL mode. |
I want to report that on VSCode 1.52 I can no longer reproduce this example of my previous comment. I know that it can still crash in some circuntances, but the performance has certainly improved. |
I am affected with this issue too. WSL is slow within the terminal of visual code while WSL alone is running well outside visual code. |
Any updates on this? I'm facing the same issue. |
Same (lame) issue here. |
Windows 11 Pro Terminal still has a longer latency in VSCode than in Windows Terminal on WSL. This issue is still apparent. |
@aeschli I believe this is related to the remote protocol, not the terminal. Also, there's this closely related SSH issue https://github.com/microsoft/vscode-remote-release/issues/5695 |
@Tyriar Any pointers and measurements to what is slow? |
I believe this is a duplicate of https://github.com/microsoft/vscode-remote-release/issues/5695 |
Or that issue is a duplicate of this? As it was only opened 22 days ago, and this has been up for well over a year, with far more information in it |
Since this report is about the terminal specifically let's track in #135644 |
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
The integrated terminal seems to be a bit slow when using WSL2.
I have zsh installed but i don't think its that because Windows Terminal is snappy and works fine in the same directories, the issue is only in the integrated terminal.
It isn't super slow, but it does have a laggy feel.
The issue doesn't appear to be with WSL as other terminals outside of VSCode are fine.
The text was updated successfully, but these errors were encountered: