Uh oh!
There was an error while loading. Please reload this page.
bpo-46993: Speed up bytearray creation from list and tuple - #31834
Merged
Conversation
kumaraditya303
marked this pull request as ready for review
March 12, 2022 09:41
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kumaraditya303
marked this pull request as draft
March 13, 2022 06:30
kumaraditya303
marked this pull request as ready for review
March 13, 2022 07:28
gvanrossum
approved these changes
Mar 13, 2022
gvanrossum
left a comment
Member
There was a problem hiding this comment.
Yes, much better.
I suppose there's a way to observe the new behavior, if the jump to the slow path must be taken: the offending subtype-of-long-instance will see that its __index__ method is called twice. But I see no reason this would matter.
asvetlov
approved these changes
Mar 15, 2022
kumaraditya303
commented
Mar 15, 2022
ContributorAuthor
Thanks @asvetlov and @gvanrossum |
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 freeto 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.
Speeds up bytearray creation from list and tuples.
Benchmark:
Result:
Mean +- std dev: [base] 74.8 us +- 5.5 us -> [patch] 53.2 us +- 3.3 us: 1.41x fasterhttps://bugs.python.org/issue46993