[PR #18001] Optimize til::rle to do replacing a little faster #31421

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

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

State: closed
Merged: No


Summary of the Pull Request

This change is based on two assumptions: Heavy row text attributes changes mostly occur in a linear way of replacing last spaces, or after last changed location. With some cost of bookkeeping, this will improve performance of scanning the needed index in these scenarios. It's not useful in daily situations, more like a small step to win the benchmarking game.

terminal size 200x50
ccat-a                     516.086 / 13.058            39.523 MB/s +10.92%
bat-a                      512.921 / 15.730            32.607 MB/s +2.35%
bat-u                      513.349 / 18.030            28.472 MB/s +5.88%
cell                       515.505 / 11.789            43.727 MB/s +15.11%
edit                       517.943 / 11.600            44.652 MB/s +0.86%

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/18001 **State:** closed **Merged:** No --- ## Summary of the Pull Request This change is based on two assumptions: Heavy row text attributes changes mostly occur in a linear way of replacing last spaces, or after last changed location. With some cost of bookkeeping, this will improve performance of scanning the needed index in these scenarios. It's not useful in daily situations, more like a small step to win the benchmarking game. ``` terminal size 200x50 ccat-a 516.086 / 13.058 39.523 MB/s +10.92% bat-a 512.921 / 15.730 32.607 MB/s +2.35% bat-u 513.349 / 18.030 28.472 MB/s +5.88% cell 515.505 / 11.789 43.727 MB/s +15.11% edit 517.943 / 11.600 44.652 MB/s +0.86% ``` ## PR Checklist - [ ] Closes #xxx - [ ] 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 (if necessary)
claunia added the pull-request label 2026-01-31 09:47:11 +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#31421