jquast
wcwidth
BlogDocsChangelog

improve width() performance

#181Merged
Comparing
jq/width-improvement
(
85e8957
) with
master
(
7a398cb
)
CodSpeed Performance Gauge
+59%
Improvement
7
Untouched
31

Benchmarks

38 total
test_width_complex_ansi
tests/test_benchmarks.py
CodSpeed Performance Gauge
+59%
83.6 µs52.7 µs
test_width_udhr
tests/test_benchmarks.py
CodSpeed Performance Gauge
+39%
193.3 ms138.9 ms
test_ljust_udhr_lines
tests/test_benchmarks.py
CodSpeed Performance Gauge
+38%
2.4 ms1.8 ms
test_rjust_udhr_lines
tests/test_benchmarks.py
CodSpeed Performance Gauge
+38%
2.4 ms1.8 ms
test_center_udhr_lines
tests/test_benchmarks.py
CodSpeed Performance Gauge
+36%
2.5 ms1.9 ms
test_strip_sequences_simple
tests/test_benchmarks.py
CodSpeed Performance Gauge
+12%
29.7 µs26.5 µs
test_wrap_japanese
tests/test_benchmarks.py
CodSpeed Performance Gauge
+11%
5.9 ms5.3 ms
test_strip_sequences_complex
tests/test_benchmarks.py
CodSpeed Performance Gauge
+3%
32.4 µs31.5 µs
test_wrap_udhr
tests/test_benchmarks.py
CodSpeed Performance Gauge
+3%
672.5 ms655.6 ms
test_wcwidth_combining
tests/test_benchmarks.py
CodSpeed Performance Gauge
+2%
14.3 µs14.1 µs
test_wcwidth_emoji
tests/test_benchmarks.py
CodSpeed Performance Gauge
+2%
14.3 µs14.1 µs
test_wcwidth_ascii
tests/test_benchmarks.py
CodSpeed Performance Gauge
+2%
21.1 µs20.8 µs
test_iter_sequences_plain
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
33.8 µs33.4 µs
test_wcwidth_wide
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
17.2 µs17 µs
test_wcswidth_udhr
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
25.4 µs25.1 µs
test_wcswidth_short_ascii
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
21 µs20.8 µs
test_wcswidth_emoji_sequence
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
50.1 µs49.8 µs
test_iter_sequences_mixed
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
55.1 µs54.8 µs
test_width_with_ansi_codes
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
56.3 µs55.9 µs
test_wcswidth_long_ascii
tests/test_benchmarks.py
CodSpeed Performance Gauge
+1%
21.7 µs21.6 µs
test_rjust_japanese
tests/test_benchmarks.py
CodSpeed Performance Gauge
0%
43.7 µs43.5 µs
test_clip_ascii
tests/test_benchmarks.py
CodSpeed Performance Gauge
0%
25 µs24.9 µs
test_iter_graphemes_combining
tests/test_benchmarks.py
CodSpeed Performance Gauge
0%
315.5 µs314.1 µs
test_center_mixed
tests/test_benchmarks.py
CodSpeed Performance Gauge
0%
43.3 µs43.1 µs
test_iter_graphemes_emoji
tests/test_benchmarks.py
CodSpeed Performance Gauge
0%
116.2 µs115.8 µs

Commits

Click on a commit to change the comparison range
Base
master
7a398cb
-23.3%
Merge remote-tracking branch 'origin/master' into jq/width-improvement
5f55f28
1 day ago
by jquast
0%
better document "glitch emoji" test measurements
627a93d
1 day ago
by jquast
+81.93%
try something of a compromise, long v. short strings
b3f5a3e
1 day ago
by jquast
0%
make tests match our un-expectations
332c4e5
1 day ago
by jquast
0%
provide full branch coverage
85e8957
1 day ago
by jquast
© 2026 CodSpeed Technology
Home Terms Privacy Docs