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.10] Make MESSAGE_TYPES_WITH_CONTENT a frozenset for the WebSocketReader #8750

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 ✅

Project coverage is 97.69%. Comparing base (fbfedd6) to head (75cd6f0).
Report is 2 commits behind head on 3.10.

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

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 83bd239 into 3.10 Aug 19, 2024
30 of 31 checks passed
@bdraco bdraco deleted the patchback/backports/3.10/e97b17a6d0fc8b5d4c1f46822eed389724fee8f7/pr-8747 branch August 19, 2024 18:17
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