[PR #9202] [MERGED] Initial implementation of fine-grained text analysis #27463

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/9202
Author: @skyline75489
Created: 2/18/2021
Status: Merged
Merged: 4/28/2021
Merged by: @undefined

Base: mainHead: chesterliu/dev/analysis-text-complexity


📝 Commits (10+)

  • 32b24c6 Initial implementation of fine-grained text analysis
  • 651f970 Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • 7cf30a0 Feedback
  • fc8eaa5 Auditing & Format
  • ce22c12 Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • 716202e Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • 78f1b02 Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • c175a86 Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • 00cdf6a Merge branch 'main' into chesterliu/dev/analysis-text-complexity
  • 0491659 Feedback

📊 Changes

2 files changed (+53 additions, -42 deletions)

View changed files

📝 src/renderer/dx/CustomTextLayout.cpp (+51 -38)
📝 src/renderer/dx/CustomTextLayout.h (+2 -4)

📄 Description

This PR aims to optimize the text analysis process by breaking the text
into simple & complex runs according to the result of
GetTextComplexity. For simple runs, we can skip certain processing
steps to improve the analysis performance.

Previous to this PR, we rely on the result of AnalyzeBidi,
AnalyzeScript and AnalyzeNumberSubstitution to both break the text
into different runs and attach the corresponding
bidi/script/number_substitution information to the run. Thanks to #6695
we have the chance to skip the expensive analysis process when we found
the entire text is determined to be simple.

Inspired by https://github.com/microsoft/cascadia-code/issues/411 and
discussions in #9156, I found that the "entire text simplicity" is often
hard to meet. In order to fully utilize the complexity information of
the text, we need to first break the text into simple & complex ranges.
These ranges are also the initial runs prior to the
bidi/script/number_substitution analysis. This way we can skip the text
analysis for simple runs to speed up the process.

VALIDATION
Build & run cmatrix, cacafire, cat big.txt with it.

Initial simple run PR: #6695
Closes #9156


🔄 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/9202 **Author:** [@skyline75489](https://github.com/skyline75489) **Created:** 2/18/2021 **Status:** ✅ Merged **Merged:** 4/28/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `chesterliu/dev/analysis-text-complexity` --- ### 📝 Commits (10+) - [`32b24c6`](https://github.com/microsoft/terminal/commit/32b24c67e64c82aed3e959589e1fbea2aed97fe7) Initial implementation of fine-grained text analysis - [`651f970`](https://github.com/microsoft/terminal/commit/651f9705cd6fd950374ba5934bcddb6965fd2fd0) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`7cf30a0`](https://github.com/microsoft/terminal/commit/7cf30a0366680e2c56ee8db6ca139e271bbe6d96) Feedback - [`fc8eaa5`](https://github.com/microsoft/terminal/commit/fc8eaa565a510492dbcdaa24f58f52e3a4a01aeb) Auditing & Format - [`ce22c12`](https://github.com/microsoft/terminal/commit/ce22c122dfcfcea73cf2572eb0e93f9e6c6ae1fc) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`716202e`](https://github.com/microsoft/terminal/commit/716202ecfb621822aafb866b4bf4457be16f9389) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`78f1b02`](https://github.com/microsoft/terminal/commit/78f1b029a1647c791d93210effb3bb24d5f6ba6a) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`c175a86`](https://github.com/microsoft/terminal/commit/c175a869023e4461558956da314e0fed9871e322) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`00cdf6a`](https://github.com/microsoft/terminal/commit/00cdf6a7fafbe225e82c8e1e8d7a6bc704133a93) Merge branch 'main' into chesterliu/dev/analysis-text-complexity - [`0491659`](https://github.com/microsoft/terminal/commit/0491659140636252a9dd6a5fe23daefa60cb97d4) Feedback ### 📊 Changes **2 files changed** (+53 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/dx/CustomTextLayout.cpp` (+51 -38) 📝 `src/renderer/dx/CustomTextLayout.h` (+2 -4) </details> ### 📄 Description This PR aims to optimize the text analysis process by breaking the text into simple & complex runs according to the result of `GetTextComplexity`. For simple runs, we can skip certain processing steps to improve the analysis performance. Previous to this PR, we rely on the result of `AnalyzeBidi`, `AnalyzeScript` and `AnalyzeNumberSubstitution` to both break the text into different runs and attach the corresponding bidi/script/number_substitution information to the run. Thanks to #6695 we have the chance to skip the expensive analysis process when we found the *entire text* is determined to be simple. Inspired by https://github.com/microsoft/cascadia-code/issues/411 and discussions in #9156, I found that the "entire text simplicity" is often hard to meet. In order to fully utilize the complexity information of the text, we need to first break the text into simple & complex ranges. These ranges are also the initial runs prior to the bidi/script/number_substitution analysis. This way we can skip the text analysis for simple runs to speed up the process. VALIDATION Build & run cmatrix, cacafire, cat big.txt with it. Initial simple run PR: #6695 Closes #9156 --- <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:22:07 +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#27463