Skip to content

Python 3.15 unicodedata.iter_graphemes() integration#206

Open
jquast wants to merge 14 commits into
masterfrom
jq/python-315-iter-graphemes
Open

Python 3.15 unicodedata.iter_graphemes() integration#206
jquast wants to merge 14 commits into
masterfrom
jq/python-315-iter-graphemes

Conversation

@jquast
Copy link
Copy Markdown
Owner

@jquast jquast commented Feb 2, 2026

We can use unicodedata.iter_graphemes() added in Python 3.15 for a (probably) faster iter_graphemes() and its many dependencies, like wrap().

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6ddc5ea) to head (a673460).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jquast jquast changed the title Python 3.15 integration Integrate with Python 3.15 unicodedata.iter_graphemes() Feb 2, 2026
@jquast
Copy link
Copy Markdown
Owner Author

jquast commented Feb 6, 2026

Paused until codspeed supports python 3.15 -- it should show faster performance

@jquast jquast changed the title Integrate with Python 3.15 unicodedata.iter_graphemes() Python 3.15 unicodedata.iter_graphemes() integration Jun 1, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 1, 2026

Merging this PR will improve performance by 40.59%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

#### 🎉 Hooray! `pytest-codspeed` just leveled up to 5.0.3!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

⚡ 33 improved benchmarks
✅ 55 untouched benchmarks

Performance Changes

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)

Open in CodSpeed

@jquast jquast marked this pull request as ready for review June 1, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant