bpo-46041: Add identity comparison micro-optimizations to listobject.c#30036
Closed
tekknolagi wants to merge 2 commits intopython:mainfrom
Closed
bpo-46041: Add identity comparison micro-optimizations to listobject.c#30036tekknolagi wants to merge 2 commits intopython:mainfrom
tekknolagi wants to merge 2 commits intopython:mainfrom
Conversation
Add two micro-optimizations similar to [bpo-39425](https://bugs.python.org/issue39425) that avoid reference counting in the fast path.
Member
|
Can you show some micro benchmark results where this makes a difference? It adds a comparison for every element until the equal one, and only saves at most one incref/decref pair per lookup. So it's not a clear win. |
Contributor
Author
|
Sure, let me figure out how to make and run one of those fairly. |
Contributor
Author
|
After some microbenchmarking with pyperf, I cannot find much of a win in this. This only really makes sense in the context of a workload involving a fork, where you want to avoid a CoW. Thanks. |
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.
Add two micro-optimizations similar to
bpo-39425 that avoid reference
counting in the fast path.
https://bugs.python.org/issue46041