[PR #10566] Use memcmp for TextAttribute & TextColor comparison #28113

Closed
opened 2026-01-31 09:26:25 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/10566

State: closed
Merged: Yes


TextAttribute and TextColor are commonly used structures in hot paths.
This commit replaces more complex comparisons where each field is compared
independently with a single call to memcmp. This compiles down to just
a few instructions. This reduces code and binary size and improves
performance for paths were TextAttributes need to be compared.

PR Checklist

  • Supports What about 'over all windows' as Task Manager? (#10563)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Validation Steps Performed

  • termbench still works ✔️

Co-authored-by: Leonard Hecker lhecker@microsoft.com

**Original Pull Request:** https://github.com/microsoft/terminal/pull/10566 **State:** closed **Merged:** Yes --- `TextAttribute` and `TextColor` are commonly used structures in hot paths. This commit replaces more complex comparisons where each field is compared independently with a single call to `memcmp`. This compiles down to just a few instructions. This reduces code and binary size and improves performance for paths were `TextAttribute`s need to be compared. ## PR Checklist * [x] Supports #10563 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Validation Steps Performed * termbench still works ✔️ Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
claunia added the pull-request label 2026-01-31 09:26:25 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28113