[PR #10533] [MERGED] Improve parser performance by reducing tracing overhead #28094

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10533
Author: @lhecker
Created: 6/29/2021
Status: Merged
Merged: 6/30/2021
Merged by: @lhecker

Base: mainHead: dev/lhecker/perf-vt-tracing


📝 Commits (3)

  • 4f3dd6c Improve parser performance by reducing tracing overhead
  • 8fd1414 Address reviewer comments
  • 100386e Fix formatting check

📊 Changes

2 files changed (+25 additions, -20 deletions)

View changed files

📝 src/terminal/parser/tracing.cpp (+8 -14)
📝 src/terminal/parser/tracing.hpp (+17 -6)

📄 Description

Passing structures larger than the register size is very expensive
due to Microsoft's x64 calling convention. We could reduce the
overhead by passing the string-view by reference, but this forces us
to allocate the parameters as static string-views on the data
segment of our binary. I've found that passing them as classic
C-strings is more ergonomic instead and fits the need for
high performance in this particular code.
This improves performance for VT-heavy output by 15-20%.

PR Checklist

  • I work here
  • Tests added/passed

🔄 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/10533 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 6/29/2021 **Status:** ✅ Merged **Merged:** 6/30/2021 **Merged by:** [@lhecker](https://github.com/lhecker) **Base:** `main` ← **Head:** `dev/lhecker/perf-vt-tracing` --- ### 📝 Commits (3) - [`4f3dd6c`](https://github.com/microsoft/terminal/commit/4f3dd6c97ac27cd2f447006ca29f6af535d36a73) Improve parser performance by reducing tracing overhead - [`8fd1414`](https://github.com/microsoft/terminal/commit/8fd141485b2fc55260381c4c23aba0d7bc9a41a4) Address reviewer comments - [`100386e`](https://github.com/microsoft/terminal/commit/100386eb1d8d2a11061329caca352da053985968) Fix formatting check ### 📊 Changes **2 files changed** (+25 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/terminal/parser/tracing.cpp` (+8 -14) 📝 `src/terminal/parser/tracing.hpp` (+17 -6) </details> ### 📄 Description Passing structures larger than the register size is very expensive due to Microsoft's x64 calling convention. We could reduce the overhead by passing the string-view by reference, but this forces us to allocate the parameters as static string-views on the data segment of our binary. I've found that passing them as classic C-strings is more ergonomic instead and fits the need for high performance in this particular code. This improves performance for VT-heavy output by 15-20%. ## PR Checklist * [x] I work here * [x] Tests added/passed --- <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:26:18 +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#28094