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

Optimize _query_var for str objects #1131

Merged
merged 9 commits into from
Sep 8, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Sep 8, 2024

What do these changes do?

_query_var is almost never called with subclassed values, and almost everything is str. All the issubclass calls add up with large query strings

0.0006691671442240477 <- is
0.0010826669167727232 <- issubclass

Are there changes in behavior for the user?

No

_query_var is almost never called with subclassed values
and all the issubclass calls add up with large query strings
yarl/_url.py Outdated Show resolved Hide resolved
yarl/_url.py Outdated Show resolved Hide resolved
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Sep 8, 2024
yarl/_url.py Outdated Show resolved Hide resolved
yarl/_url.py Outdated Show resolved Hide resolved
CHANGES/1131.misc.rst Outdated Show resolved Hide resolved
CHANGES/1131.misc.rst Outdated Show resolved Hide resolved
@bdraco bdraco changed the title Optimize _query_var for non-subclassed objects Optimize _query_var for str objects Sep 8, 2024
Copy link

codecov bot commented Sep 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.15%. Comparing base (ee90b00) to head (37d9812).
Report is 285 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1131      +/-   ##
==========================================
+ Coverage   95.12%   95.15%   +0.03%     
==========================================
  Files          30       30              
  Lines        4638     4647       +9     
  Branches      410      411       +1     
==========================================
+ Hits         4412     4422      +10     
+ Misses        200      199       -1     
  Partials       26       26              
Flag Coverage Δ
CI-GHA 95.11% <100.00%> (+0.03%) ⬆️
MyPy 41.10% <100.00%> (+<0.01%) ⬆️
OS-Linux 99.38% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.48% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.08% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 98.97% <100.00%> (+<0.01%) ⬆️
Py-3.10.14 99.22% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 99.22% <100.00%> (+<0.01%) ⬆️
Py-3.12.5 99.22% <100.00%> (+<0.01%) ⬆️
Py-3.13.0-rc.1 99.22% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 98.92% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 99.16% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.92% <100.00%> (+<0.01%) ⬆️
Py-3.9.19 99.16% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.11 99.22% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.22% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.25% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.08% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.38% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.48% <100.00%> (+<0.01%) ⬆️
pytest 99.38% <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.

CHANGES/1131.misc.rst Outdated Show resolved Hide resolved
@bdraco bdraco marked this pull request as ready for review September 8, 2024 20:29
@bdraco bdraco enabled auto-merge (squash) September 8, 2024 20:29
@bdraco bdraco merged commit 0cfca85 into master Sep 8, 2024
44 of 46 checks passed
@bdraco bdraco deleted the query_var_fast_path_non_subclassed branch September 8, 2024 20:29
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