KEMBAR78
gh-99941: asyncio.Protocol.data_received now received immutable bytes by DarioDaF · Pull Request #100053 · python/cpython · GitHub
Skip to content

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.

@ghost
Copy link

ghost 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