[PR #10426] [MERGED] Prefer FMT_COMPILE for string formatting in VtRenderer #28047

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10426
Author: @skyline75489
Created: 6/15/2021
Status: Merged
Merged: 6/22/2021
Merged by: @undefined

Base: mainHead: chesterliu/dev/dirty-formatting


📝 Commits (10+)

📊 Changes

5 files changed (+35 additions, -112 deletions)

View changed files

📝 .github/actions/spelling/allow/microsoft.txt (+1 -0)
📝 src/host/ut_host/VtRendererTests.cpp (+5 -5)
📝 src/renderer/vt/VtSequences.cpp (+18 -40)
📝 src/renderer/vt/state.cpp (+1 -66)
📝 src/renderer/vt/vtrenderer.hpp (+10 -1)

📄 Description

Kill WriteFormattedString and replace it with fmt::format_to to avoid expensive string operations in VtRenderer.

This saves ~8% of the CPU time.

Inspired by https://github.com/microsoft/terminal/issues/10362#issuecomment-856625365

Co-authored-by: Leonard Hecker lhecker@microsoft.com


🔄 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/10426 **Author:** [@skyline75489](https://github.com/skyline75489) **Created:** 6/15/2021 **Status:** ✅ Merged **Merged:** 6/22/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `chesterliu/dev/dirty-formatting` --- ### 📝 Commits (10+) - [`581c697`](https://github.com/microsoft/terminal/commit/581c69739dab6232050e5f9282e3cb1fa7f56efc) Draft implementation for fast string formatting - [`1ca22cd`](https://github.com/microsoft/terminal/commit/1ca22cd8d61b7515876c21e89fb18cd3a4df6d27) why not work - [`7231332`](https://github.com/microsoft/terminal/commit/7231332377db11c4d024a58c782179836cada5d6) OK now it works - [`d03136e`](https://github.com/microsoft/terminal/commit/d03136e90f26650c4f9ea46e44c631ccb53e87c2) Stack allocation only - [`f48e594`](https://github.com/microsoft/terminal/commit/f48e59427f5d0bce727df6f1cb340d25ebd52104) Use FMT_COMPILE - [`8b89940`](https://github.com/microsoft/terminal/commit/8b899407827e7c9421984c56fea33c18321b54f7) Code health - [`c677fbd`](https://github.com/microsoft/terminal/commit/c677fbd79b72ad323d61a537d10ce1db9a4f2587) small_vector - [`1321f05`](https://github.com/microsoft/terminal/commit/1321f05ab5226509a288ee10c5e250ec908f2fa5) Use std::back_insertor - [`88e8e0a`](https://github.com/microsoft/terminal/commit/88e8e0a3811f88de9c96b356acb53d12b6afaf08) Apply patch from Leonard - [`1043b61`](https://github.com/microsoft/terminal/commit/1043b61bf0cdb7ffb55caf5dee0f85a4bc62883f) Yeah this also works ### 📊 Changes **5 files changed** (+35 additions, -112 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/microsoft.txt` (+1 -0) 📝 `src/host/ut_host/VtRendererTests.cpp` (+5 -5) 📝 `src/renderer/vt/VtSequences.cpp` (+18 -40) 📝 `src/renderer/vt/state.cpp` (+1 -66) 📝 `src/renderer/vt/vtrenderer.hpp` (+10 -1) </details> ### 📄 Description Kill `WriteFormattedString` and replace it with `fmt::format_to` to avoid expensive string operations in VtRenderer. This saves ~8% of the CPU time. Inspired by https://github.com/microsoft/terminal/issues/10362#issuecomment-856625365 Co-authored-by: Leonard Hecker <lhecker@microsoft.com> --- <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:25:58 +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#28047