bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant#26391
Merged
vstinner merged 1 commit intopython:mainfrom May 26, 2021
vstinner:math_micro_optim
Merged
bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant#26391vstinner merged 1 commit intopython:mainfrom vstinner:math_micro_optim
vstinner merged 1 commit intopython:mainfrom
vstinner:math_micro_optim
Conversation
Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside loops in functions: * math.comb() * math.gcd() * math.lcm() * math.perm()
Member
Author
|
This change should be backport to 3.10 since it fix a minor performance regression introduced in Python 3.10: https://bugs.python.org/issue42161#msg388988 |
Member
Author
|
cc @rhettinger |
Member
Author
|
I didn't notice that _PyLong_GetZero() and _PyLong_GetOne() were used in loops in Modules/mathmodule.c when I wrote my commit 3783413 (I tried to pay attention to that, to avoid performance regression). |
erlend-aasland
approved these changes
May 26, 2021
Contributor
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
May 26, 2021
|
GH-26393 is a backport of this pull request to the 3.10 branch. |
Member
Author
|
Thanks for the review @erlend-aasland. |
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.
Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside
loops in functions:
https://bugs.python.org/issue42161