[PR #6573] [MERGED] Improved ATTR_ROW::ReplaceAttrs performance #26740

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6573
Author: @lhecker
Created: 6/18/2020
Status: ✅ Merged
Merged: 6/19/2020
Merged by: @undefined

Base: master ← Head: attr-row-perf


📝 Commits (1)

  • 321442e Improved ATTR_ROW::ReplaceAttrs performance

📊 Changes

1 file changed (+22 additions, -45 deletions)

View changed files

📝 src/buffer/out/AttrRow.cpp (+22 -45)

📄 Description

Summary of the Pull Request

Improve ATTR_ROW::ReplaceAttrs performance by only reserving the necessary capacity instead of resizing the new run.
That way TextAttributeRuns are only instantiated once instead of twice.

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be 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

Detailed Description of the Pull Request / Additional comments

Performance could be further improved by directly moving TextAttributeRuns into the new vector, but I considered this out of scope for this PR.

Validation Steps Performed

CPU usage when running cacafire is slightly reduced.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/6573 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 6/18/2020 **Status:** ✅ Merged **Merged:** 6/19/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `attr-row-perf` --- ### 📝 Commits (1) - [`321442e`](https://github.com/microsoft/terminal/commit/321442e4bc4068dcb48de8323c78943015cd9ad1) Improved ATTR_ROW::ReplaceAttrs performance ### 📊 Changes **1 file changed** (+22 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/AttrRow.cpp` (+22 -45) </details> ### 📄 Description ## Summary of the Pull Request Improve `ATTR_ROW::ReplaceAttrs` performance by only reserving the necessary capacity instead of resizing the new run. That way `TextAttributeRun`s are only instantiated once instead of twice. ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be 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 ## Detailed Description of the Pull Request / Additional comments Performance could be further improved by directly moving `TextAttributeRun`s into the new vector, but I considered this out of scope for this PR. ## Validation Steps Performed CPU usage when running `cacafire` is slightly reduced. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:17:51 +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#26740