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 with_query when passing an empty value #1328

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 18, 2024

Passing an empty str or an empty dict to with_query was much more expensive than passing None

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 18, 2024
@bdraco bdraco changed the title Imporve performance of with_query when passing an empty string Imporve performance of with_query when passing an empty string Oct 18, 2024
@bdraco bdraco changed the title Imporve performance of with_query when passing an empty string Imporve performance of with_query when passing an empty value Oct 18, 2024
Copy link

codspeed-hq bot commented Oct 18, 2024

CodSpeed Performance Report

Merging #1328 will improve performances by 51.92%

Comparing query_cleanups (253539b) with master (8e445f4)

Summary

⚡ 2 improvements
✅ 77 untouched benchmarks

Benchmarks breakdown

Benchmark master query_cleanups Change
test_update_query_empty 424.1 µs 355.9 µs +19.18%
test_with_query_empty 233.6 µs 153.7 µs +51.92%

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.98%. Comparing base (8e445f4) to head (253539b).
Report is 124 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1328   +/-   ##
=======================================
  Coverage   95.98%   95.98%           
=======================================
  Files          27       27           
  Lines        5428     5430    +2     
  Branches      329      330    +1     
=======================================
+ Hits         5210     5212    +2     
  Misses        192      192           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 95.98% <100.00%> (+<0.01%) ⬆️
MyPy 44.48% <33.33%> (+<0.01%) ⬆️
OS-Linux 99.32% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.37% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.05% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 99.03% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 99.03% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.27% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 98.98% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 99.23% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.28% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.30% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.05% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.32% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.37% <100.00%> (+<0.01%) ⬆️
pytest 99.32% <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 Imporve performance of with_query when passing an empty value Improve performance of with_query when passing an empty value Oct 18, 2024
@bdraco bdraco marked this pull request as ready for review October 18, 2024 06:29
@bdraco bdraco merged commit a071e6d into master Oct 18, 2024
43 of 46 checks passed
@bdraco bdraco deleted the query_cleanups branch October 18, 2024 06: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