Should we have a ThrottledFunc that works without a dispatcher? #14190

Closed
opened 2026-01-31 04:03:22 +00:00 by claunia · 3 comments
Owner

Originally created by @skyline75489 on GitHub (Jun 10, 2021).

I found that I need something like ThrottledFunc, but works in DxRenderer. There's something that's such a pain point, is that we're wasting valuable CPU times redrawing cursors when we actually don't need to . I know this long ago, just hit this again when investigating #10362 . This is an example WPR trace:

image

To update the cursor, the underlying buffer is frequently checked for IsCursorDoubleWidth, which consumes valuable CPU times and totally not necessary.

A simple solution would be remember the timestamp of the last update and refuse to update it until a certain period of time passes.

Originally created by @skyline75489 on GitHub (Jun 10, 2021). I found that I need something like ThrottledFunc, but works in DxRenderer. There's something that's such a pain point, is that we're wasting valuable CPU times redrawing cursors when we actually don't need to . I know this long ago, just hit this again when investigating #10362 . This is an example WPR trace: ![image](https://user-images.githubusercontent.com/4710575/121506972-cfd70a80-ca16-11eb-9d3c-c87d2d266bb6.png) To update the cursor, the underlying buffer is frequently checked for `IsCursorDoubleWidth`, which consumes valuable CPU times and totally not necessary. A simple solution would be remember the timestamp of the last update and refuse to update it until a certain period of time passes.
Author
Owner

@skyline75489 commented on GitHub (Jun 10, 2021):

CC @lhecker for thoughts

@skyline75489 commented on GitHub (Jun 10, 2021): CC @lhecker for thoughts
Author
Owner

@lhecker commented on GitHub (Jun 10, 2021):

@skyline75489 I wrote a til::throttled_func without a dispatcher just yesterday. hahahahaha
I can contribute it separately today if you want to. 👍

@lhecker commented on GitHub (Jun 10, 2021): @skyline75489 I wrote a `til::throttled_func` without a dispatcher just yesterday. hahahahaha I can contribute it separately today if you want to. 👍
Author
Owner

@ghost commented on GitHub (Jul 14, 2021):

:tada:This issue was addressed in #10403, which has now been successfully released as Windows Terminal Preview v1.10.1933.0.🎉

Handy links:

@ghost commented on GitHub (Jul 14, 2021): :tada:This issue was addressed in #10403, which has now been successfully released as `Windows Terminal Preview v1.10.1933.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.10.1933.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14190