Python 3.15 unicodedata.iter_graphemes() integration#206
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #206 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 1525 1541 +16
Branches 365 369 +4
=========================================
+ Hits 1525 1541 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Paused until codspeed supports python 3.15 -- it should show faster performance |
…dth into jq/python-315-iter-graphemes
Merging this PR will improve performance by 40.59%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_iter_graphemes_combining |
306.2 µs | 76.5 µs | ×4 |
| ⚡ | test_iter_graphemes_emoji |
114.4 µs | 42.3 µs | ×2.7 |
| ⚡ | test_iter_graphemes_ascii |
115 µs | 46.1 µs | ×2.5 |
| ⚡ | test_clip_cursor_cr_control_codes_ignore |
605.6 µs | 320.6 µs | +88.9% |
| ⚡ | test_clip_long_cjk_overtype |
10.5 ms | 5.9 ms | +78.44% |
| ⚡ | test_clip_cursor_cr_overwrite |
2.8 ms | 1.7 ms | +65.29% |
| ⚡ | test_clip_long_cjk_past_window |
432.2 µs | 270.9 µs | +59.53% |
| ⚡ | test_clip_long_cjk_control_codes_ignore |
432.1 µs | 271.9 µs | +58.95% |
| ⚡ | test_wcwidth_ascii |
21.5 µs | 13.7 µs | +56.95% |
| ⚡ | test_clip_cursor_csi_backward |
829.9 µs | 556.5 µs | +49.12% |
| ⚡ | test_clip_complex_sgr_no_overtype |
251.7 µs | 177.2 µs | +42.01% |
| ⚡ | test_clip_complex_sgr |
258.8 µs | 183.1 µs | +41.39% |
| ⚡ | test_clip_japanese |
112.5 µs | 81.9 µs | +37.25% |
| ⚡ | test_clip_dense_ansi_control_codes_ignore |
545.8 µs | 406.3 µs | +34.31% |
| ⚡ | test_clip_dense_ansi_no_overtype |
543 µs | 406.9 µs | +33.45% |
| ⚡ | test_wcwidth_emoji |
13.9 µs | 10.6 µs | +31.37% |
| ⚡ | test_wcwidth_combining |
14.3 µs | 10.9 µs | +30.67% |
| ⚡ | test_clip_with_ansi_no_propagate |
119.3 µs | 94.5 µs | +26.22% |
| ⚡ | test_clip_dense_ansi_overtype |
642.5 µs | 511.1 µs | +25.71% |
| ⚡ | test_clip_dense_ansi_past_window |
774.6 µs | 644.3 µs | +20.22% |
| ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jq/python-315-iter-graphemes (a673460) with master (6ddc5ea)
We can use
unicodedata.iter_graphemes()added in Python 3.15 for a (probably) fasteriter_graphemes()and its many dependencies, likewrap().