Terminal: Rendering slows down under load

Created on 19 Jun 2019  路  7Comments  路  Source: microsoft/terminal

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.

Area-Performance Issue-Bug Product-Terminal Resolution-Fix-Committed

All 7 comments

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.

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.

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.

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.

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 :)

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.

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

Was this page helpful?
0 / 5 - 0 ratings