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

Improve performance of URL.build by avoiding operations #1297

Merged
merged 7 commits into from
Oct 16, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 16, 2024

URL.build had a few places left where performance could be improved

Copy link

codspeed-hq bot commented Oct 16, 2024

CodSpeed Performance Report

Merging #1297 will improve performances by 31.98%

Comparing test_new_method (db26fd3) with master (cd1d352)

Summary

⚡ 10 improvements
✅ 51 untouched benchmarks

Benchmarks breakdown

Benchmark master test_new_method Change
test_url_build_access_fragment 857.4 µs 727.6 µs +17.83%
test_url_build_access_raw_host 992.1 µs 857.8 µs +15.65%
test_url_build_access_raw_path 903.8 µs 774.5 µs +16.7%
test_url_build_access_username_password 1,113.1 µs 978.4 µs +13.77%
test_url_build_encoded_with_host_and_port 639.9 µs 507.2 µs +26.18%
test_url_build_with_different_hosts 2.3 ms 1.9 ms +17.13%
test_url_build_with_host 712.6 µs 586.5 µs +21.5%
test_url_build_with_host_and_port 941.1 µs 806.6 µs +16.68%
test_url_build_with_host_path_and_port 854.4 µs 723.5 µs +18.1%
test_url_build_with_simple_query 3.6 ms 2.7 ms +31.98%

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.88%. Comparing base (cd1d352) to head (db26fd3).
Report is 151 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1297   +/-   ##
=======================================
  Coverage   95.87%   95.88%           
=======================================
  Files          27       27           
  Lines        5290     5297    +7     
  Branches      316      316           
=======================================
+ Hits         5072     5079    +7     
  Misses        192      192           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 95.88% <100.00%> (+<0.01%) ⬆️
MyPy 44.18% <80.00%> (+<0.01%) ⬆️
OS-Linux 99.30% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.35% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.02% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 99.00% <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 99.00% <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.21% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.26% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.28% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.02% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.30% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.35% <100.00%> (+<0.01%) ⬆️
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 bdraco changed the title DNM: Test SplitResult creation methods Improve performance of URL.build by avoiding unnecessary lambda Oct 16, 2024
@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 changed the title Improve performance of URL.build by avoiding unnecessary lambda Improve performance of URL.build by avoiding operations Oct 16, 2024
@bdraco bdraco changed the title Improve performance of URL.build by avoiding operations Improve performance of URL.build by avoiding operations Oct 16, 2024
@bdraco bdraco marked this pull request as ready for review October 16, 2024 15:53
@bdraco bdraco merged commit d40efff into master Oct 16, 2024
43 of 46 checks passed
@bdraco bdraco deleted the test_new_method branch October 16, 2024 15:53
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