-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Avoid memory copy in the WebSocket reader for small payloads #9649
Conversation
CodSpeed Performance ReportMerging #9649 will improve performances by 41.4%Comparing Summary
Benchmarks breakdown
|
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #9650 🤖 @patchback |
(cherry picked from commit f2f5b05)
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 #9649 +/- ##
=======================================
Coverage 98.64% 98.64%
=======================================
Files 115 115
Lines 35417 35437 +20
Branches 4199 4203 +4
=======================================
+ Hits 34938 34958 +20
Misses 321 321
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… reader for small payloads (#9650) **This is a backport of PR #9649 as merged into master (f2f5b05).** Only convert to `bytearray` when we know we are going to append messages or unmask. If the message comes in without being fragmented, we can avoid many conversions from `bytes` to `bytearray` which is the common case for small messages Co-authored-by: J. Nick Koston <[email protected]>
Only convert to
bytearray
when we know we are going to append messages or unmask. If the message comes in without being fragmented, we can avoid many conversions frombytes
tobytearray
which is the common case for small messages