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 the URL.with_path method #1307

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 17, 2024

Most of the time here is spent rebuilding the URL. Getting rid of _replace makes this a lot faster

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 17, 2024
@bdraco bdraco changed the title Improve with_path performance Improve performance of the with_path method Oct 17, 2024
@bdraco bdraco changed the title Improve performance of the with_path method Improve performance of the URL.with_path method Oct 17, 2024
Copy link

codspeed-hq bot commented Oct 17, 2024

CodSpeed Performance Report

Merging #1307 will improve performances by 94.92%

Comparing with_path_perf (d243f4e) with master (780de98)

Summary

⚡ 1 improvements
✅ 64 untouched benchmarks

Benchmarks breakdown

Benchmark master with_path_perf Change
test_url_with_path 859.8 µs 441.1 µs +94.92%

@bdraco bdraco marked this pull request as ready for review October 17, 2024 20:39
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.37%. Comparing base (fa83191) to head (d243f4e).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1307      +/-   ##
==========================================
+ Coverage   95.90%   99.37%   +3.47%     
==========================================
  Files          27       19       -8     
  Lines        5323     4346     -977     
  Branches      320      270      -50     
==========================================
- Hits         5105     4319     -786     
+ Misses        192       22     -170     
+ Partials       26        5      -21     
Flag Coverage Δ
CI-GHA 99.30% <100.00%> (+3.40%) ⬆️
MyPy ?
OS-Linux 99.30% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.36% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.03% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 99.01% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.26% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.26% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 99.01% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.26% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.26% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.96% <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.29% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.03% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.30% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.36% <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 merged commit 0f49197 into master Oct 17, 2024
44 of 46 checks passed
@bdraco bdraco deleted the with_path_perf branch October 17, 2024 20:57
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