GeezerVison is showing github.com — gh-120176: Reduce number of compares in index range checks by lgeiger · Pull Request #120181 · python/cpython
Conversation
lgeiger
commented
Jun 6, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This PR is a followup to #9784 (discussed in #72583 and #67741) and extracts the helper function into internal/pycore_abstract.h and uses it where applicable to reduce the number of comparisons in index range checks.
See https://godbolt.org/z/jM8oexT1d for an assembly comparison.
I feel like this change doesn't reduce readability but let me know if such micro optimisation does not justify the code churn.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ghost
commented
Jun 6, 2024
•
edited by ghost
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
All commit authors signed the Contributor License Agreement. 
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
|
lgeiger reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
No news entry is required because this change is not visible to users.
I assume performance gain is not large enough to have news entry.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I will wait a week before merging this PR to ensure that other committers have the opportunity to review it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This idea was already discussed and rejected. See #72583.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ah sorry, didn't see #99762
Sorry about that!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
methane
methane approved these changes
markshannon
Awaiting requested review from markshannon
markshannon is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.