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 building query strings with MultiDict #1256

Merged
merged 4 commits into from
Oct 13, 2024
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 13, 2024

Most of the time aiohttp is passing in a MulitDict here. This will also help a bit for dict without Sequence, but as not a common of a case

For historical reasons we have support for sequences inside of MulitDict even though it shouldn't happen and it would be a breaking change to remove it

most of the time aiohttp is passing in a multidict here
@bdraco

This comment was marked as outdated.

Copy link

codspeed-hq bot commented Oct 13, 2024

CodSpeed Performance Report

Merging #1256 will improve performances by 28.21%

Comparing optimize_for_multidict (e43a7a3) with master (ef4b498)

Summary

⚡ 4 improvements
✅ 41 untouched benchmarks

Benchmarks breakdown

Benchmark master optimize_for_multidict Change
test_url_extend_query_existing_query_simple_query_dict 1,075.3 µs 843.9 µs +27.41%
test_url_extend_query_simple_query_dict 1,055.5 µs 824.9 µs +27.94%
test_url_make_with_query_mapping 1,047.8 µs 817.3 µs +28.21%
test_url_make_with_query_sequence_mapping 5 ms 4 ms +25.08%

Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.84%. Comparing base (5c56ba2) to head (e43a7a3).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1256   +/-   ##
=======================================
  Coverage   95.83%   95.84%           
=======================================
  Files          27       27           
  Lines        5168     5174    +6     
  Branches      314      314           
=======================================
+ Hits         4953     4959    +6     
  Misses        189      189           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 95.82% <100.00%> (+<0.01%) ⬆️
MyPy 43.88% <100.00%> (+0.06%) ⬆️
OS-Linux 99.35% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.41% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.06% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 98.97% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 98.97% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 98.92% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 99.18% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.92% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 99.18% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.11 99.24% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.24% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.26% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.06% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.35% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.41% <100.00%> (+<0.01%) ⬆️
pytest 99.35% <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 Optimize building query strings with MultiDict Optimize building query strings with MultiDict and dicts without sequences Oct 13, 2024
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 13, 2024
@bdraco bdraco changed the title Optimize building query strings with MultiDict and dicts without sequences Optimize building query strings with MultiDict Oct 13, 2024
@bdraco bdraco marked this pull request as ready for review October 13, 2024 17:00
@bdraco bdraco merged commit 5d6ff6c into master Oct 13, 2024
49 of 51 checks passed
@bdraco bdraco deleted the optimize_for_multidict branch October 13, 2024 17:01
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