gh-145192: Improve performance of PySequence_GetSlice#145193
Open
eendebakpt wants to merge 4 commits intopython:mainfrom
Open
gh-145192: Improve performance of PySequence_GetSlice#145193eendebakpt wants to merge 4 commits intopython:mainfrom
eendebakpt wants to merge 4 commits intopython:mainfrom
Conversation
| @@ -0,0 +1 @@ | |||
| Improve performance of :c:func:`PySequence_GetSlice`. | |||
Contributor
There was a problem hiding this comment.
The Change Looks really good to me, thank You for fixing this!
I only suggest going a Bit more in Detail for the Description, but very nice fix!
LGTM!
Suggested change
| Improve performance of :c:func:`PySequence_GetSlice`. | |
| Improve performance of :c:func:`PySequence_GetSlice` by avoiding unnecessary reference count decrements. |
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.
PySequence_GetSliceby avoiding an incref/decref pairs in_PySlice_FromIndices_PyBuildSlice_Consume2is refactored so that in consumes references. Before it had the funny property of consuming refs of the the first 2 two slice arguments, but not of the last._PyBuildSlice_ConsumeRefs(used in the opcode_BINARY_SLICE) avoids an incref onPy_NoneThe
PySequence_GetSliceis part of the C api, with no direct equivalent from Python, so the benchmark is in C.Main:
PR
Benchmark details
Run with optimized FT build.
Code: