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

Add benchmark for streaming API iter_chunks #10426

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Add benchmark for streaming API iter_chunks #10426

merged 1 commit into from
Feb 6, 2025

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Feb 6, 2025

Benchmark to demo the benefit of iter_chunks over read

Most of the time is spent in getting the data from llhttp into python objects, but its still significantly faster to use iter_chunks vs read because it avoids another copy.
Screenshot 2025-02-06 at 10 02 30 AM

@bdraco bdraco added bot:chronographer:skip This PR does not need to include a change note backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot labels Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (0d44b6a) to head (bb24ebd).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10426   +/-   ##
=======================================
  Coverage   98.76%   98.76%           
=======================================
  Files         122      122           
  Lines       37116    37135   +19     
  Branches     2044     2046    +2     
=======================================
+ Hits        36656    36675   +19     
  Misses        320      320           
  Partials      140      140           
Flag Coverage Δ
CI-GHA 98.65% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.33% <100.00%> (+<0.01%) ⬆️
OS-Windows 96.25% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.45% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 97.33% <100.00%> (+<0.01%) ⬆️
Py-3.10.16 97.91% <100.00%> (+<0.01%) ⬆️
Py-3.11.11 97.99% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 97.43% <100.00%> (+<0.01%) ⬆️
Py-3.12.8 98.43% <100.00%> (+<0.01%) ⬆️
Py-3.13.1 98.41% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 97.23% <94.73%> (-0.01%) ⬇️
Py-3.9.21 97.79% <94.73%> (-0.01%) ⬇️
Py-pypy7.3.16 97.37% <100.00%> (+<0.01%) ⬆️
VM-macos 97.45% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.33% <100.00%> (+<0.01%) ⬆️
VM-windows 96.25% <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.

Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #10426 will not alter performance

Comparing iter_chunks (bb24ebd) with master (0d44b6a)

Summary

✅ 47 untouched benchmarks
🆕 1 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop] N/A 108.1 ms N/A

@bdraco bdraco marked this pull request as ready for review February 6, 2025 16:02
@bdraco bdraco requested a review from asvetlov as a code owner February 6, 2025 16:02
@bdraco bdraco enabled auto-merge (squash) February 6, 2025 16:07
@bdraco bdraco merged commit fae142f into master Feb 6, 2025
40 checks passed
@bdraco bdraco deleted the iter_chunks branch February 6, 2025 16:07
Copy link
Contributor

patchback bot commented Feb 6, 2025

Backport to 3.11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.11/fae142f59841d64eb57bed189397f9baca0c44a6/pr-10426

Backported as #10427

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link
Contributor

patchback bot commented Feb 6, 2025

Backport to 3.12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.12/fae142f59841d64eb57bed189397f9baca0c44a6/pr-10426

Backported as #10428

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 6, 2025
bdraco added a commit that referenced this pull request Feb 6, 2025
bdraco added a commit that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant