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

gh-99941: asyncio.Protocol.data_received now received immutable bytes #100053

Merged
merged 4 commits into from
Dec 10, 2022

Conversation

DarioDaF
Copy link
Contributor

@DarioDaF DarioDaF commented Dec 6, 2022

Made asyncio.Protocol.data_received receive immutable object
bytes instead of bytearrays (like defined in the docs) with regression tests added
and opted to use memoryview to take the slices for performance on big buffers.

Performance test from #21442 done on my machine with 10
repetitions on release build with timings 0.043 (delta: 0.019) before patch
and 0.041 (delta: 0.010) after so no noticable change in performance.

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented Dec 6, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Dec 10, 2022

@gvanrossum Is this what you intended? I thought that we were going for a documentation update and some unittests though I might be misunderstanding. If this is to be accepted then we need more benchmarks with larger payloads to verify.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits for the news entry. I'll apply that and then merge.

@python python deleted a comment from netlify bot Dec 10, 2022
@gvanrossum gvanrossum merged commit 1bb68ba into python:main Dec 10, 2022
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.

4 participants