Extremely slow performance when processing virtual terminal sequences #14157

Open
opened 2026-01-31 04:02:27 +00:00 by claunia · 0 comments
Owner

Originally created by @cmuratori on GitHub (Jun 8, 2021).

Windows Terminal version (or Windows build number)

1.8.1521.0

Other Software

No response

Steps to reproduce

Using any command line utility that produces virtual terminal sequences for setting the colors of individual characters, the performance of the terminal drops by a factor of around 40.

To measure this effect precisely, you can use the F2 key in termbench and observe the performance difference between color-per-character output and single-color output:

https://github.com/cmuratori/termbench/releases/tag/V1

Expected Behavior

Despite the increased parsing load, modern CPUs should not have a problem parsing per-character color escape codes quickly. I would expect the performance of the terminal to be able to sustain roughly the same frame rate with per-character color codes as without, and if there was a performance drop, I wouldn't expect it to be anything close to 40x.

Actual Behavior

The speed of per-character color output is 40x slower than the speed of single-color output.

Originally created by @cmuratori on GitHub (Jun 8, 2021). ### Windows Terminal version (or Windows build number) 1.8.1521.0 ### Other Software _No response_ ### Steps to reproduce Using any command line utility that produces virtual terminal sequences for setting the colors of individual characters, the performance of the terminal drops by a factor of around 40. To measure this effect precisely, you can use the F2 key in termbench and observe the performance difference between color-per-character output and single-color output: https://github.com/cmuratori/termbench/releases/tag/V1 ### Expected Behavior Despite the increased parsing load, modern CPUs should not have a problem parsing per-character color escape codes quickly. I would expect the performance of the terminal to be able to sustain roughly the same frame rate with per-character color codes as without, and if there was a performance drop, I wouldn't expect it to be anything close to 40x. ### Actual Behavior The speed of per-character color output is 40x slower than the speed of single-color output.
claunia added the Needs-TriageNeeds-Tag-FixArea-Performance labels 2026-01-31 04:02:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14157