-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Restore zero copy writes on Python 3.12.9+/3.13.2+ #10137
Draft
bdraco
wants to merge
5
commits into
master
Choose a base branch
from
restore_zero_copy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdraco
changed the title
Restore zero copy support on Python 3.12.9+/3.13.2+
Restore zero copy writes on Python 3.12.9+/3.13.2+
Dec 6, 2024
bdraco
added
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
Dec 6, 2024
CodSpeed Performance ReportMerging #10137 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #10137 +/- ##
==========================================
+ Coverage 97.18% 98.75% +1.56%
==========================================
Files 120 122 +2
Lines 36888 37031 +143
Branches 4301 4432 +131
==========================================
+ Hits 35851 36571 +720
+ Misses 824 313 -511
+ Partials 213 147 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
psf-chronographer
bot
added
the
bot:chronographer:provided
There is a change note present in this PR
label
Dec 6, 2024
bdraco
commented
Dec 6, 2024
webknjaz
reviewed
Dec 6, 2024
webknjaz
reviewed
Dec 6, 2024
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
CVE-2024-12254 aka GHSA-fw89-6wjj-8j95 is fixed on these Python versions
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <sviat@redhat.com>
bdraco
force-pushed
the
restore_zero_copy
branch
from
December 6, 2024 17:23
894af34
to
85b21f7
Compare
# for free
to join this conversation on GitHub.
Already have an account?
# 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO
What do these changes do?
Restore zero copy support on Python 3.12.9+/3.13.2+ (unreleased at this time)
CVE-2024-12254 aka GHSA-fw89-6wjj-8j95 is fixed on these Python versions
Are there changes in behavior for the user?
The performance regression introduced by disabling zero copy writes in #10125 will be resolved
The relevant benchmarks (keep in mind we are benchmarking disabling zero copy writes), and this PR seeks to restore the performance:
test_one_hundred_get_requests_with_1024_chunked_payload
+3% (writelines
is a bit worse for tiny payloads)test_one_hundred_get_requests_with_512kib_chunked_payload
-21% (writelines
is a lot better for large payloads)test_one_hundred_get_requests_with_30000_chunked_payload
-4% (writelines
is a slightly better for medium size payloads)Since we already have to branch here, I also added
MIN_PAYLOAD_FOR_WRITELINES
to 2048 to ensure we no longer take the 3% performance hit forwritelines
with small payloads