Skip to content

Significantly improve performance of the unquoter#1496

Merged
bdraco merged 14 commits intomasterfrom
quoter___Pyx_UnicodeContainsUCS4
Apr 6, 2025
Merged

Significantly improve performance of the unquoter#1496
bdraco merged 14 commits intomasterfrom
quoter___Pyx_UnicodeContainsUCS4

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Apr 5, 2025

unsafe can only be extended ascii (0-255) so this check can be a bit cheaper as we can do char compares and avoid calling __Pyx_UnicodeContainsUCS4

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 5, 2025

CodSpeed Performance Report

Merging #1496 will improve performances by 85.67%

Comparing quoter___Pyx_UnicodeContainsUCS4 (e09fcff) with master (99079e3)

Summary

⚡ 6 improvements
✅ 95 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_unquoter_long_ascii 22.5 ms 12.1 ms +85.67%
test_unquoter_long_pct 25.4 ms 15 ms +69.81%
test_unquoter_short 288.6 µs 204.5 µs +41.1%
test_parse_query_uncached[long] 25.4 ms 20.8 ms +21.97%
test_parse_query_uncached[short] 2 ms 1.7 ms +18.05%
test_path_safe_uncached 257.9 µs 232.1 µs +11.12%

@codecov
Copy link

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.93%. Comparing base (99079e3) to head (e09fcff).
Report is 42 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1496   +/-   ##
=======================================
  Coverage   98.92%   98.93%           
=======================================
  Files          32       32           
  Lines        6074     6087   +13     
  Branches      365      365           
=======================================
+ Hits         6009     6022   +13     
  Misses         62       62           
  Partials        3        3           
Flag Coverage Δ
CI-GHA 98.93% <100.00%> (+<0.01%) ⬆️
MyPy 98.07% <ø> (ø)
OS-Linux 98.78% <100.00%> (+<0.01%) ⬆️
OS-Windows 98.82% <ø> (ø)
OS-macOS 98.56% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 98.54% <100.00%> (+<0.01%) ⬆️
Py-3.10.16 98.74% <100.00%> (+<0.01%) ⬆️
Py-3.11.11 98.74% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 98.54% <100.00%> (+<0.01%) ⬆️
Py-3.12.9 98.74% <100.00%> (+<0.01%) ⬆️
Py-3.13.2 98.74% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.50% <100.00%> (+<0.01%) ⬆️
Py-3.9.21 98.70% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 98.69% <ø> (ø)
Py-pypy7.3.19 98.71% <ø> (ø)
VM-macos-latest 98.56% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 98.78% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 98.82% <ø> (ø)
pytest 98.78% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Apr 5, 2025
@bdraco bdraco changed the title Refactor quoter to avoid __Pyx_UnicodeContainsUCS4 Significantly improve performance of the unquoter Apr 5, 2025
@bdraco bdraco marked this pull request as ready for review April 6, 2025 00:48
@bdraco bdraco merged commit 194ab70 into master Apr 6, 2025
48 of 50 checks passed
@bdraco bdraco deleted the quoter___Pyx_UnicodeContainsUCS4 branch April 6, 2025 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant