Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use faster Python unicode API for unquoter #1292

Merged
merged 25 commits into from
Oct 16, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 16, 2024

Every character that was being iterated during unquote was calling __Pyx_GetItemInt_Unicode

Its a bit faster to use PyUnicode_READ instead

Copy link

codspeed-hq bot commented Oct 16, 2024

CodSpeed Performance Report

Merging #1292 will improve performances by 8.19%

Comparing avoid_malloc_nothing_to_quote_c_api_unquoter (17f2da3) with master (e776a70)

Summary

⚡ 2 improvements
✅ 54 untouched benchmarks

Benchmarks breakdown

Benchmark master avoid_malloc_nothing_to_quote_c_api_unquoter Change
test_unquoter_long_ascii 7.2 ms 6.6 ms +8.19%
test_unquoter_long_pct 7.4 ms 6.9 ms +7.41%

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.85%. Comparing base (e776a70) to head (17f2da3).
Report is 157 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1292   +/-   ##
=======================================
  Coverage   95.85%   95.85%           
=======================================
  Files          27       27           
  Lines        5261     5263    +2     
  Branches      311      311           
=======================================
+ Hits         5043     5045    +2     
  Misses        192      192           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 95.85% <100.00%> (+<0.01%) ⬆️
MyPy 44.14% <ø> (ø)
OS-Linux 99.30% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.35% <ø> (ø)
OS-macOS 99.02% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 98.99% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.25% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.25% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 98.99% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.25% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.25% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.95% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 99.20% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.25% <ø> (ø)
Py-pypy7.3.17 99.28% <ø> (ø)
VM-macos-latest 99.02% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.30% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.35% <ø> (ø)
pytest 99.30% <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.

@bdraco
Copy link
Member Author

bdraco commented Oct 16, 2024

We don't have any benchmarks for accessing the properties that need to go through the unquoter

@bdraco bdraco closed this Oct 16, 2024
@bdraco bdraco reopened this Oct 16, 2024
@bdraco
Copy link
Member Author

bdraco commented Oct 16, 2024

could be faster if no change as well

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 16, 2024
@bdraco bdraco closed this Oct 16, 2024
@bdraco bdraco reopened this Oct 16, 2024
@bdraco bdraco marked this pull request as ready for review October 16, 2024 07:06
@bdraco bdraco merged commit 4533b3c into master Oct 16, 2024
78 of 81 checks passed
@bdraco bdraco deleted the avoid_malloc_nothing_to_quote_c_api_unquoter branch October 16, 2024 07:06
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