Repository navigation
Conversation
Merging this PR will improve performance by ×3.8
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_length_emoji_vs16 |
672.5 µs | 43.8 µs | ×15 |
| ⚡ | test_length_cjk |
770.2 µs | 69.7 µs | ×11 |
| ⚡ | test_truncate_emoji_zwj |
966.1 µs | 89.7 µs | ×11 |
| ⚡ | test_length_emoji_zwj |
188 µs | 28.5 µs | ×6.6 |
| ⚡ | test_center_cjk |
780.1 µs | 130.4 µs | ×6 |
| ⚡ | test_ljust_cjk |
778.3 µs | 130.7 µs | ×6 |
| ⚡ | test_rjust_cjk |
777.8 µs | 131 µs | ×5.9 |
| ⚡ | test_truncate_cjk |
518.7 µs | 97.5 µs | ×5.3 |
| ⚡ | test_center_ansi |
389.2 µs | 108.2 µs | ×3.6 |
| ⚡ | test_rjust_ansi |
382.7 µs | 108 µs | ×3.5 |
| ⚡ | test_ljust_ansi |
381.1 µs | 108.3 µs | ×3.5 |
| ⚡ | test_center_emoji_zwj |
206 µs | 69.1 µs | ×3 |
| ⚡ | test_rjust_emoji_zwj |
202.7 µs | 69.1 µs | ×2.9 |
| ⚡ | test_ljust_emoji_zwj |
202.8 µs | 69.2 µs | ×2.9 |
| ⚡ | test_length_ansi |
373.4 µs | 170.2 µs | ×2.2 |
| ⚡ | test_center_ascii |
47 µs | 34.7 µs | +35.42% |
| ⚡ | test_rjust_ascii |
43.6 µs | 34.6 µs | +25.97% |
| ⚡ | test_ljust_ascii |
43.6 µs | 34.7 µs | +25.71% |
| ⚡ | test_length_ascii |
37 µs | 31.2 µs | +18.41% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jq/wcwidth-0.9.1 (f55f278) with master (362dbe2)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #420 +/- ##
==========================================
+ Coverage 97.72% 97.75% +0.02%
==========================================
Files 13 13
Lines 4052 4106 +54
Branches 739 695 -44
==========================================
+ Hits 3960 4014 +54
+ Misses 71 70 -1
- Partials 21 22 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rename and classify some internal things, support ambiguous width and term_program
This comment was marked as off-topic.
This comment was marked as off-topic.
jquast
marked this pull request as ready for review
October 5, 2026 00:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TERM_PROGRAMenvironment value is defined, no query is madedetect_ambiguous_width()after class initialization auto-applies the results to alignment functionalignments for the below varies among all identifiable terminals, but are now aligned, 10 of them on linux in screenshot below:
Unidentifiable terminals continue to be out of alignment sometimes, they can't be helped:
Actually, there are many more ways to identify a terminal, at least
ENQ, and some terminal authors even believeDA1response, but I think it is best to support only the progressive/modern methods. And these are the only kinds of terminals supported bywcstwidth()anyway.