Rendering slows down under load #1739

Closed
opened 2026-01-30 22:35:10 +00:00 by claunia · 7 comments
Owner

Originally created by @MSFTFox on GitHub (Jun 19, 2019).

Originally assigned to: @miniksa on GitHub.

Environment

Windows build number: Microsoft Windows [Version 10.0.18922.1000]

Steps to reproduce

When working under load, (was building an Android project at the time), I had a second tab open trying to copy/paste or type git commands.

Expected behavior

One tab shouldn't affect another. Rendering on the new tab was error prone with strange behavior at times.

Performing the same actions in a separately opened PowerShell or command prompt window performed as expected with little to no input latency.

Actual behavior

Each character from the pasted text appeared individually, one after another with a noticeable pause in between. Typing regular characters seemed to print out an incorrect character at times which was overwritten moments later by the correct one. At other times, the current line would re-render to the right of the cursor just to be overwritten as the cursor progressed.

Originally created by @MSFTFox on GitHub (Jun 19, 2019). Originally assigned to: @miniksa on GitHub. <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18922.1000] ``` # Steps to reproduce When working under load, (was building an Android project at the time), I had a second tab open trying to copy/paste or type git commands. <!-- A description of how to trigger this bug. --> # Expected behavior One tab shouldn't affect another. Rendering on the new tab was error prone with strange behavior at times. Performing the same actions in a separately opened PowerShell or command prompt window performed as expected with little to no input latency. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior <!-- What's actually happening? --> Each character from the pasted text appeared individually, one after another with a noticeable pause in between. Typing regular characters seemed to print out an incorrect character at times which was overwritten moments later by the correct one. At other times, the current line would re-render to the right of the cursor just to be overwritten as the cursor progressed.
Author
Owner

@zadjii-msft commented on GitHub (Jun 19, 2019):

Could you share what commandline applications you were running that caused this apparent lag? What shell were you pasting into (powershell, cmd, wsl)?

Were you you using a "debug" or a "release" build?

To me, this almost sounds like conpty lag more than terminal lag, but I'd need a more exact repro scenario to be able to investigate more.

@zadjii-msft commented on GitHub (Jun 19, 2019): Could you share what commandline applications you were running that caused this apparent lag? What shell were you pasting into (powershell, cmd, wsl)? Were you you using a "debug" or a "release" build? To me, this almost sounds like conpty lag more than terminal lag, but I'd need a more exact repro scenario to be able to investigate more.
Author
Owner

@MSFTFox commented on GitHub (Jun 19, 2019):

I had two PowerShell tabs open. I was running a gradle android build in one tab and attempting to paste into the other. This should be a release build.

I thought it was regular lag as well, but the performance difference between a tabbed PowerShell window versus an entirely new window was too great.

@MSFTFox commented on GitHub (Jun 19, 2019): I had two PowerShell tabs open. I was running a gradle android build in one tab and attempting to paste into the other. This should be a release build. I thought it was regular lag as well, but the performance difference between a tabbed PowerShell window versus an entirely new window was too great.
Author
Owner

@skyline75489 commented on GitHub (Sep 30, 2019):

As in #806 I've made cmatrix performace better than before, but the 'typing regular characters seemed to print out an incorrect character' behaviour is still there. Seems tabs are affecting each other in an unintended way. Will try to find out why.

@skyline75489 commented on GitHub (Sep 30, 2019): As in #806 I've made `cmatrix` performace better than before, but the 'typing regular characters seemed to print out an incorrect character' behaviour is still there. Seems tabs are affecting each other in an unintended way. Will try to find out why.
Author
Owner

@ocitrev commented on GitHub (Feb 28, 2020):

I wrote a little program to stress the CPU to help reproduce this bug: stress.cpp. If I simulate heavy load on the PC with this simple program, I can reproduce this issue 100% of the time.

Here is a screen grab comparing Terminal and Console. Left window is Windows Terminal (Preview) Version: 0.9.433.0. Right window is pwsh.exe's console.
Steps in the video:

  • start stress.exe in the upper pane,
  • Left click in lower pane to give focus
  • Right click in lower pane to paste long text
  • Left click on right console to give focus
  • Right click to paste same long text

input-delay

You can see that the Console is much faster that Terminal. I hit this problem often, especially when I do a full build on my large C++ application.

I also noted that increasing the priority on OpenConsole.exe or Terminal.exe does not improve the situation much. To my surprise I need to increase the priority of the shell application running in the terminal to reduce this lag when the PC is under heavy load.

@ocitrev commented on GitHub (Feb 28, 2020): I wrote a little program to stress the CPU to help reproduce this bug: [stress.cpp](https://gist.github.com/ocitrev/5d2014c225bfe2e9057e26e55f0c4722). If I simulate heavy load on the PC with this simple program, I can reproduce this issue 100% of the time. Here is a screen grab comparing Terminal and Console. Left window is Windows Terminal (Preview) Version: 0.9.433.0. Right window is pwsh.exe's console. Steps in the video: - start stress.exe in the upper pane, - Left click in lower pane to give focus - Right click in lower pane to paste long text - Left click on right console to give focus - Right click to paste same long text ![input-delay](https://user-images.githubusercontent.com/2294428/75574459-59361980-5a2c-11ea-8d72-084ce9d01d1e.gif) You can see that the Console is **much** faster that Terminal. I hit this problem often, especially when I do a full build on my large C++ application. I also noted that increasing the priority on OpenConsole.exe or Terminal.exe does not improve the situation much. To my surprise I need to increase the priority of the shell application running in the terminal to reduce this lag when the PC is under heavy load.
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2020):

Hey so I was investigating both #3169 and #3827, which sound a lot like this issue, though both fail to explicitly mention the "High CPU" factor which was certainly helpful.

I was able to run your stress test application on both 0.10.781, and a 0.11 pre-release build that's got #5185 in it. Fortunately, it does seem like #5185 will fix this particular issue. I'm going to leave the others open waiting for feedback, but I'm gonna assume those will also just go away when 0.11 comes out.

Thanks for providing the great repro case :)

@zadjii-msft commented on GitHub (Apr 15, 2020): Hey so I was investigating both #3169 and #3827, which sound a lot like this issue, though both fail to explicitly mention the "High CPU" factor which was certainly helpful. I was able to run your stress test application on both 0.10.781, and a 0.11 pre-release build that's got #5185 in it. Fortunately, it does seem like #5185 will fix this particular issue. I'm going to leave the others open waiting for feedback, but I'm gonna assume those will also just go away when 0.11 comes out. Thanks for providing the great repro case :)
Author
Owner

@miniksa commented on GitHub (Apr 15, 2020):

Incremental rendering is getting unspooled for 1.0 because it's too close to ship and I can't land #5345 and the other bugs it introduces in time thanks to the coronavirus.

@miniksa commented on GitHub (Apr 15, 2020): Incremental rendering is getting unspooled for 1.0 because it's too close to ship and I can't land #5345 and the other bugs it introduces in time thanks to the coronavirus.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 16, 2020):

Incremental rendering isn't being unspooled; we'll track this with #778.

@DHowett-MSFT commented on GitHub (Apr 16, 2020): Incremental rendering isn't being unspooled; we'll track this with #778.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1739