Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-35588: Speed up mod, divmod and floordiv operations for Fraction type #11322

Merged
merged 11 commits into from
Jan 2, 2019

Conversation

scoder
Copy link
Contributor

@scoder scoder commented Dec 26, 2018

Implement mod and divmod operations for Fraction type by spelling out the numerator/denominator calculation, instead of instantiating and normalising Fractions along the way. This speeds up '%' and divmod() by 2-3x.

https://bugs.python.org/issue35588

…pelling out the numerator/denominator calculation, instead of instantiating and normalising Fractions along the way. This speeds up '%' and divmod() by 2-3x.
@scoder scoder force-pushed the bpo35588-fraction-divmod branch from a8607eb to 7a624bf Compare December 26, 2018 09:58
@scoder scoder changed the title bpo-35588: Speed up mod and divmod operations for Fraction type bpo-35588: Speed up mod, divmod and floordiv operations for Fraction type Dec 26, 2018
Co-Authored-By: scoder <stefan_ml@behnel.de>
@asvetlov
Copy link
Contributor

@serhiy-storchaka the patch looks great for me.
I'd like to merge it in a day or two if nobody objects.

Copy link
Contributor

@eamanu eamanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @asvetlov I think is ready to merge.

@serhiy-storchaka
Copy link
Member

I'll merge this PR after New Year if @rhettinger and @mdickinson do not have objections.

@serhiy-storchaka serhiy-storchaka merged commit 3a374e0 into python:master Jan 2, 2019
@bedevere-bot
Copy link

@serhiy-storchaka: Please replace # with GH- in the commit message next time. Thanks!

@serhiy-storchaka
Copy link
Member

Due to some GitHub bug my edition of the commit message was ignored, and changes were committed with an awful commit message.

@serhiy-storchaka serhiy-storchaka removed their assignment Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants