gh-150621: avoid quadratic bytes slicing in asyncio.protocols._feed_data_to_buffered_proto#150622
Open
deadlovelll wants to merge 3 commits into
Open
gh-150621: avoid quadratic bytes slicing in asyncio.protocols._feed_data_to_buffered_proto#150622deadlovelll wants to merge 3 commits into
asyncio.protocols._feed_data_to_buffered_proto#150622deadlovelll wants to merge 3 commits into
Conversation
asyncio.protocols._feed_data_to_buffered_proto
asyncio.protocols._feed_data_to_buffered_proto asyncio.protocols._feed_data_to_buffered_proto
Member
|
FTR, the titles of your PRs are always missing a colon after the |
Contributor
Author
Thank you! I'll take this into account for the future |
7e04c75 to
cfda592
Compare
picnixz
reviewed
May 30, 2026
Member
There was a problem hiding this comment.
- Can you update your benchmarks?
- If there is a way to see the improvement with a visible example (like, where is this function being called in a real-world application, or if there is some public endpoint we can refer to), please add a NEWS entry mentioning this improvement.
- Can you add some tests that would exercise this change if none exists?
- Please don't force-push in the future (here it's ok because I didn't review it yet, but forcepushing discards commit history and incremental reviews are hard).
Contributor
Author
Updated benchmarks. Removed memoryview mentions from issue and PR description.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track the offset into
datainstead of reslicing. Drops total work from O(N^2) to O(N).See gh-150621 for the benchmark table.
To get the results of new version run:
./python.exe buffer_memory_view_bench.py --variant new -o new.jsonTo get the results of old one:
./python.exe buffer_memory_view_bench.py --variant old -o old.jsonGet the compare table:
./python.exe -m pyperf compare_to old.json new.json --tableBenchmark script