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

Avoid creation of tuples to create new URL objects #1398

Merged
merged 35 commits into from
Oct 30, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 30, 2024

Instead of creating a tuple and passing it to cls._from_tup, pass the parts to cls._from_parts, and to avoid packing and unpacking the tuple. The arguments still have to be unpacked but its a bit faster.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 30, 2024
Copy link

codspeed-hq bot commented Oct 30, 2024

CodSpeed Performance Report

Merging #1398 will not alter performance

Comparing try_another_way (70c8bd8) with master (3f2c26f)

Summary

✅ 82 untouched benchmarks

@bdraco bdraco changed the title Dnm: Fully eliminate self._val (another method) Avoid creation of tuples to create new URL objects Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.05%. Comparing base (3f2c26f) to head (70c8bd8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1398   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files          31       31           
  Lines        5748     5752    +4     
  Branches      342      342           
=======================================
+ Hits         5521     5525    +4     
  Misses        201      201           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 96.05% <100.00%> (+<0.01%) ⬆️
MyPy 48.87% <100.00%> (+0.03%) ⬆️
OS-Linux 99.55% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.61% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.30% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 99.46% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.52% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.55% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.30% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.55% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.61% <100.00%> (+<0.01%) ⬆️
pytest 99.55% <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 30, 2024

Its ~5% faster. Not enough for codspeed's margin of error

@bdraco bdraco marked this pull request as ready for review October 30, 2024 16:23
@bdraco bdraco merged commit 07798bf into master Oct 30, 2024
44 of 46 checks passed
@bdraco bdraco deleted the try_another_way branch October 30, 2024 16:44
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