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 serializing headers #10014

Merged
merged 4 commits into from
Nov 21, 2024
Merged

Improve performance of serializing headers #10014

merged 4 commits into from
Nov 21, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 21, 2024

  • Avoids ref counting in to_str since Cython can use a fast Py_TYPE check
  • Only call to_str once per each key and value
  • inline the CRLF check since its only used in one place now

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Nov 21, 2024
Avoids ref counting in `to_str` since Cython
can use a fast Py_TYPE check instead

Only call `to_str` once per each key and value
@bdraco bdraco added backport-3.10 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 Nov 21, 2024
Copy link

codspeed-hq bot commented Nov 21, 2024

CodSpeed Performance Report

Merging #10014 will improve performances by 27.66%

Comparing serialize_headers (d7dcf42) with master (c984a44)

Summary

⚡ 1 improvements
✅ 42 untouched benchmarks

Benchmarks breakdown

Benchmark master serialize_headers Change
test_serialize_headers 1.3 ms 1 ms +27.66%

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (c984a44) to head (d7dcf42).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10014   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         121      121           
  Lines       36727    36727           
  Branches     4384     4384           
=======================================
  Hits        36261    36261           
  Misses        314      314           
  Partials      152      152           
Flag Coverage Δ
CI-GHA 98.61% <ø> (ø)
OS-Linux 98.30% <ø> (ø)
OS-Windows 96.13% <ø> (ø)
OS-macOS 97.40% <ø> (ø)
Py-3.10.11 97.25% <ø> (+<0.01%) ⬆️
Py-3.10.15 97.79% <ø> (ø)
Py-3.11.10 97.83% <ø> (ø)
Py-3.11.9 97.30% <ø> (-0.01%) ⬇️
Py-3.12.7 98.36% <ø> (ø)
Py-3.13.0 98.33% <ø> (-0.02%) ⬇️
Py-3.9.13 97.17% <ø> (ø)
Py-3.9.20 97.71% <ø> (ø)
Py-pypy7.3.16 97.32% <ø> (+<0.01%) ⬆️
VM-macos 97.40% <ø> (ø)
VM-ubuntu 98.30% <ø> (ø)
VM-windows 96.13% <ø> (ø)

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 marked this pull request as ready for review November 21, 2024 03:07
@bdraco bdraco enabled auto-merge (squash) November 21, 2024 03:07
@bdraco bdraco merged commit 50d23ae into master Nov 21, 2024
37 checks passed
@bdraco bdraco deleted the serialize_headers branch November 21, 2024 03:18
Copy link
Contributor

patchback bot commented Nov 21, 2024

Backport to 3.10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.10/50d23aeec46295ef3490770245966505d5e9de0c/pr-10014

Backported as #10015

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

Copy link
Contributor

patchback bot commented Nov 21, 2024

Backport to 3.11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.11/50d23aeec46295ef3490770245966505d5e9de0c/pr-10014

Backported as #10016

🤖 @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 Nov 21, 2024
Copy link
Contributor

patchback bot commented Nov 21, 2024

Backport to 3.12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.12/50d23aeec46295ef3490770245966505d5e9de0c/pr-10014

Backported as #10017

🤖 @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 Nov 21, 2024
bdraco added a commit that referenced this pull request Nov 21, 2024
…g headers (#10016)

Co-authored-by: J. Nick Koston <nick@koston.org>
bdraco added a commit that referenced this pull request Nov 21, 2024
…g headers (#10017)

Co-authored-by: J. Nick Koston <nick@koston.org>
bdraco added a commit that referenced this pull request Nov 21, 2024
…g headers (#10015)

Co-authored-by: J. Nick Koston <nick@koston.org>
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: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