[1.19] Random lags on focus and unfocus #20550

Closed
opened 2026-01-31 07:17:15 +00:00 by claunia · 3 comments
Owner

Originally created by @lhecker on GitHub (Sep 26, 2023).

Windows Terminal version

1.19.2682.0

Windows build number

No response

Other Software

No response

Steps to reproduce

  • Run rainbowbench -ng
  • Focus and unfocus the application

Expected Behavior

rainbowbench should show something along the lines of

22486 fps | 83132 kcg/s

or about half that on a slower CPU.

Focusing/Unfocusing doesn't randomly lag the renderer.

Actual Behavior

7436 fps | 26605 kcg/s

and it randomly lags.

Originally created by @lhecker on GitHub (Sep 26, 2023). ### Windows Terminal version 1.19.2682.0 ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce * Run `rainbowbench -ng` * Focus and unfocus the application ### Expected Behavior `rainbowbench` should show something along the lines of ``` 22486 fps | 83132 kcg/s ``` or about half that on a slower CPU. Focusing/Unfocusing doesn't randomly lag the renderer. ### Actual Behavior ``` 7436 fps | 26605 kcg/s ``` and it randomly lags.
claunia added the Area-RenderingIssue-BugNeeds-Tag-FixProduct-TerminalPriority-1 labels 2026-01-31 07:17:15 +00:00
Author
Owner

@lhecker commented on GitHub (Sep 27, 2023):

The throughput issue occurs because I now flush a ConPTY frame whenever DoWriteConsole returns. Previously, ConPTY would only flush it after up to 16.7ms when the next rendering iteration occurs. I think this is fine, because I'd like to move away from the asynchronous nature of ConPTY over to a direct translation.

I can't quite figure out why I had lags though. It's been gone ever since I disabled G-SYNC and it hasn't come back even after enabling G-SYNC. Weird.

@lhecker commented on GitHub (Sep 27, 2023): The throughput issue occurs because I now flush a ConPTY frame whenever `DoWriteConsole` returns. Previously, ConPTY would only flush it after up to 16.7ms when the next rendering iteration occurs. I think this is fine, because I'd like to move away from the asynchronous nature of ConPTY over to a direct translation. I can't quite figure out why I had lags though. It's been gone ever since I disabled G-SYNC and it hasn't come back even after enabling G-SYNC. Weird.
Author
Owner

@zadjii-msft commented on GitHub (Sep 27, 2023):

This seems related to #12336, but not exactly the same.

Hypothesis: we should stop WriteFileing in EndPaint, because that blocks the I/O thread until ConPtyConnection ReadFiles ((baseless assumption))

@zadjii-msft commented on GitHub (Sep 27, 2023): This seems related to #12336, but not exactly the same. Hypothesis: we should stop `WriteFile`ing in `EndPaint`, because that blocks the I/O thread until ConPtyConnection `ReadFile`s ((baseless assumption))
Author
Owner

@lhecker commented on GitHub (Jul 9, 2025):

The lags aren't reproducible for me anymore.

@lhecker commented on GitHub (Jul 9, 2025): The lags aren't reproducible for me anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20550