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

[PR #8747/e97b17a6 backport][3.11] Make MESSAGE_TYPES_WITH_CONTENT a frozenset for the WebSocketReader #8751

Conversation

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Aug 19, 2024

This is a backport of PR #8747 as merged into master (e97b17a).

followup #8736 (comment)

frozenset is a tiny bit faster than the tuple

0.013342750000447268 vs 0.018335040998863406

from aiohttp.http_websocket import WSMsgType

import timeit
FZ = frozenset({WSMsgType.BINARY,WSMsgType.TEXT,WSMsgType.CONTINUATION})
TUP = (WSMsgType.BINARY,WSMsgType.TEXT,WSMsgType.CONTINUATION)

print (timeit.timeit("WSMsgType.TEXT in FZ", globals=locals()))
print (timeit.timeit("WSMsgType.TEXT in TUP", globals=locals()))

@bdraco bdraco enabled auto-merge (squash) August 19, 2024 17:53
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (3.11@096bc9d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.11    #8751   +/-   ##
=======================================
  Coverage        ?   97.69%           
=======================================
  Files           ?      108           
  Lines           ?    34169           
  Branches        ?     4064           
=======================================
  Hits            ?    33383           
  Misses          ?      587           
  Partials        ?      199           
Flag Coverage Δ
CI-GHA 97.59% <100.00%> (?)
OS-Linux 97.27% <100.00%> (?)
OS-Windows 94.79% <100.00%> (?)
OS-macOS 96.93% <100.00%> (?)
Py-3.10.11 97.02% <100.00%> (?)
Py-3.10.14 96.97% <100.00%> (?)
Py-3.11.9 97.21% <100.00%> (?)
Py-3.12.4 97.31% <100.00%> (?)
Py-3.8.10 94.43% <100.00%> (?)
Py-3.8.18 96.78% <100.00%> (?)
Py-3.9.13 96.92% <100.00%> (?)
Py-3.9.19 96.88% <100.00%> (?)
Py-pypy7.3.16 96.47% <100.00%> (?)
VM-macos 96.93% <100.00%> (?)
VM-ubuntu 97.27% <100.00%> (?)
VM-windows 94.79% <100.00%> (?)

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 merged commit 6086a2a into 3.11 Aug 19, 2024
30 of 31 checks passed
@bdraco bdraco deleted the patchback/backports/3.11/e97b17a6d0fc8b5d4c1f46822eed389724fee8f7/pr-8747 branch August 19, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant