Code Health: Optimize C++ Code for performance #8833

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

Originally created by @WSLUser on GitHub (Jun 5, 2020).

Description of the new feature/enhancement

As discussed in https://github.com/microsoft/terminal/issues/6350, we do not appear to be optimizing our C++ code to run faster I/O (while still maintaining safety). We should optimize code using iostream and other related header libraries but preferably with fast_io, which is fastest currently in existence, which aims to become part of the C++20 standard. https://www.thegeekstuff.com/2015/01/c-cpp-code-optimization/ is a general guide on how to optimize our code. https://github.com/expnkx/fast_io/wiki provides specific examples for different types of operations that can be optimized using fast_io.

Proposed technical implementation details (optional)

Start by merging adding #5152 and https://github.com/microsoft/terminal/pull/5080 but those will provide only small benefit. Otherwise use the fast_io wiki to help optimize code as PRs are created if relevant to the PR. Depends on: https://github.com/microsoft/terminal/issues/6350 being implemented.

Originally created by @WSLUser on GitHub (Jun 5, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement As discussed in https://github.com/microsoft/terminal/issues/6350, we do not appear to be optimizing our C++ code to run faster I/O (while still maintaining safety). We should optimize code using iostream and other related header libraries but preferably with fast_io, which is fastest currently in existence, which aims to become part of the C++20 standard. https://www.thegeekstuff.com/2015/01/c-cpp-code-optimization/ is a general guide on how to optimize our code. https://github.com/expnkx/fast_io/wiki provides specific examples for different types of operations that can be optimized using fast_io. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) Start by merging adding #5152 and https://github.com/microsoft/terminal/pull/5080 but those will provide only small benefit. Otherwise use the fast_io wiki to help optimize code as PRs are created if relevant to the PR. Depends on: https://github.com/microsoft/terminal/issues/6350 being implemented. <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:39:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8833