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

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

Merged
gvanrossum merged 4 commits into
python:mainfrom
DarioDaF:fix_#99941
Dec 10, 2022
Merged

gvanrossum merged 4 commits into
python:mainfrom
DarioDaF:fix_#99941

Conversation

@DarioDaF

@DarioDaF DarioDaF commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

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

ghost commented Dec 6, 2022

Copy link
Copy Markdown

@kumaraditya303

kumaraditya303 commented Dec 10, 2022

Copy link
Copy Markdown
Contributor

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Misc/NEWS.d/next/Windows/2022-12-06-11-16-46.gh-issue-99941.GmUQ6o.rst Outdated
@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