[PR #3438] [CLOSED] [WIP] Perf: construct & reuse clusters in output thread #25361

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3438
Author: @skyline75489
Created: 11/5/2019
Status: Closed

Base: masterHead: fix/reuseClusters


📝 Commits (7)

📊 Changes

9 files changed (+170 additions, -8 deletions)

View changed files

📝 src/buffer/out/AttrRow.cpp (+5 -0)
📝 src/buffer/out/AttrRow.hpp (+1 -0)
📝 src/buffer/out/Row.cpp (+49 -0)
📝 src/buffer/out/Row.hpp (+7 -0)
📝 src/buffer/out/textBuffer.cpp (+1 -2)
📝 src/renderer/base/Cluster.cpp (+24 -0)
📝 src/renderer/base/renderer.cpp (+69 -4)
📝 src/renderer/base/renderer.hpp (+4 -0)
📝 src/renderer/inc/Cluster.hpp (+10 -2)

📄 Description

Summary of the Pull Request

By constructing clusters for rendering early in the output thread, the rendering thread will be relieved, making overall performance better when under heavy load.

References

#3075

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

This is an attempt to tackle the TODO listed here:

94fc40ed31/src/renderer/base/renderer.cpp (L601)

I may be doing a lots of thing wrong but the performance boost is so good that I gotta share it with you guys. With this PR, catting my /etc/services takes only about 1.5 second, comparing to current release which takes about 5 seconds to do the same thing.

Validation Steps Performed


🔄 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/3438 **Author:** [@skyline75489](https://github.com/skyline75489) **Created:** 11/5/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/reuseClusters` --- ### 📝 Commits (7) - [`e9795c3`](https://github.com/microsoft/terminal/commit/e9795c34303000bd9203a0c6b7e6315383825e8f) Reuse clusters - [`eaa2c5f`](https://github.com/microsoft/terminal/commit/eaa2c5f65ef46e73d05aa0f9dcc3320218fee509) Update - [`d43d4ba`](https://github.com/microsoft/terminal/commit/d43d4bac2f53d16c8c1e1625a2ec4d790d0b05c1) Update - [`652ed30`](https://github.com/microsoft/terminal/commit/652ed3059e8bbc8134e4c3853aad1da1211fd422) Cols calculation - [`6484774`](https://github.com/microsoft/terminal/commit/64847742aa06ff6b148469281b6df576e7e262da) Fix cluster calculation - [`e3c3a7f`](https://github.com/microsoft/terminal/commit/e3c3a7f64f73313da5e9f5cf8972617a96befe7f) vector reserve - [`3f6a58b`](https://github.com/microsoft/terminal/commit/3f6a58b509d28a35853cd111857f9f505ec5dc7e) Resize ### 📊 Changes **9 files changed** (+170 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/AttrRow.cpp` (+5 -0) 📝 `src/buffer/out/AttrRow.hpp` (+1 -0) 📝 `src/buffer/out/Row.cpp` (+49 -0) 📝 `src/buffer/out/Row.hpp` (+7 -0) 📝 `src/buffer/out/textBuffer.cpp` (+1 -2) 📝 `src/renderer/base/Cluster.cpp` (+24 -0) 📝 `src/renderer/base/renderer.cpp` (+69 -4) 📝 `src/renderer/base/renderer.hpp` (+4 -0) 📝 `src/renderer/inc/Cluster.hpp` (+10 -2) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request By constructing clusters for rendering early in the output thread, the rendering thread will be relieved, making overall performance better when under heavy load. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References #3075 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #xxx * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) 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 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments This is an attempt to tackle the TODO listed here: https://github.com/microsoft/terminal/blob/94fc40ed31c0de050304248644458b21d0cce2e9/src/renderer/base/renderer.cpp#L601 I may be doing a lots of thing wrong but the performance boost is so good that I gotta share it with you guys. With this PR, catting my `/etc/services` takes only about 1.5 second, comparing to current release which takes about 5 seconds to do the same thing. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed --- <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:09:01 +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#25361