[PR #15267] Allow ROW::CopyRangeFrom to be vectorized #30565

Open
opened 2026-01-31 09:41:35 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


By rewriting the first major copy loop in CopyRangeFrom to use
pointers/iterators instead of indices for iteration, the autovectorizer
kicks in end neatly rewrites it as an unrolled SIMD loop. This improves
performance during traditional window resizes by roughly 2x and will
be quite helpful in the future for our more complex reflow resize.

Unfortunately, MSVC unrolls the loop by 4x which is too much for our
purpose, but there's no option to change that. It's still better than
not having any vectorization however, since it kicks in at 32 columns.

It also renames the function to CopyTextFrom be more in line with
the others and to avoid confusion, because it doesn't copy attributes.

Validation Steps Performed

  • Traditional resizing works
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15267 **State:** closed **Merged:** Yes --- By rewriting the first major copy loop in `CopyRangeFrom` to use pointers/iterators instead of indices for iteration, the autovectorizer kicks in end neatly rewrites it as an unrolled SIMD loop. This improves performance during traditional window resizes by roughly 2x and will be quite helpful in the future for our more complex reflow resize. Unfortunately, MSVC unrolls the loop by 4x which is too much for our purpose, but there's no option to change that. It's still better than not having any vectorization however, since it kicks in at 32 columns. It also renames the function to `CopyTextFrom` be more in line with the others and to avoid confusion, because it doesn't copy attributes. ## Validation Steps Performed * Traditional resizing works ✅
claunia added the pull-request label 2026-01-31 09:41:35 +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#30565