-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Return early in WebSocket receive
if there is no processing to do
#9679
Conversation
receive is a hot path for many downstream applications. In most we can avoid the linear search of message types to see if they need additional processing extracted from #9666
receive
if there is no processing to do
Its ~19% improvement in of the performance of |
CodSpeed Performance ReportMerging #9679 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 #9679 +/- ##
=======================================
Coverage 98.66% 98.67%
=======================================
Files 116 116
Lines 35638 35643 +5
Branches 4225 4227 +2
=======================================
+ Hits 35164 35169 +5
Misses 319 319
Partials 155 155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.11: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 3f2f4a7 on top of patchback/backports/3.11/3f2f4a705f588d79a8649bfb17018cb30431df89/pr-9679 Backporting merged PR #9679 into master
🤖 @patchback |
receive
is a hot path for many downstream applications. In most we can avoid the linear search of message types to see if they need additional processingextracted from #9666
19% speed up to
receive
for common message types. closing/closing/ping/pong will be a tiny bit slower since it has to do thePySequence_Contains
but for any WebSocket connection that has any sort of volume,TEXT
orBINARY
is going to significant exceed these message types.