Skip to content

gh-93476: Fraction.limit_denominator speed increase#93477

Closed
mscuthbert wants to merge 7 commits intopython:mainfrom
mscuthbert:fractions_limit_denominator
Closed

gh-93476: Fraction.limit_denominator speed increase#93477
mscuthbert wants to merge 7 commits intopython:mainfrom
mscuthbert:fractions_limit_denominator

Conversation

@mscuthbert
Copy link
Copy Markdown

Create only one new Fraction object during limit_denominator() instead of the four previously made.

Fixes #93476

I believe that each of the calls to Fraction() can be called with _normalize=False but I have not included that in this PR to limit the scope of changes to the minimum to verify no change in implementation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting change review performance Performance or resource usage stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase speed of Fractions.limit_denominator

6 participants