-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Streamline integer division #49762
Comments
Here's a patch that streamlines the x_divrem function in Patch details
Benchmark results Using the pidigits_bestof.py script that's posted in the bpo-4258 Unpatched Patched So the patch gives a speedup of around 90%. This particular benchmark |
Would it be possible to include integer benchmark tools to upstream? I |
Sounds good to me! An integer benchmark script in the Tools/ directory |
Well, the original code in pidigits is by me :-) (although it's not |
Results here (Athlon X2 3600+ with gcc in 64-bit mode with 30-bit
|
Useful informations for an integer benchmark:
Who has the last version of pidigit tool? Can you attach it here? :-) |
[Antoine]
Apologies for the misattribution! |
Here's the version of pidigits that I was using. |
New version of pidigit:
|
Oh, there is no version number of the benchmark tool itself! |
My numbers: # No patch # With faster_integer_division.patch Ok, it's two times faster on 64 bits CPU!!! Other notes about pidigits:
|
Updated patch. Lots of cleanup, but only one significant change: the A few more timings, this time from doing a single huge integer division: 32-bit build, 15-bit digits, unpatched: 92382.2 ms (~7.5 ns) ... and just for fun, the other combinations: 64-bit build, 15-bit digits, unpatched: 61927.5 ms (~5.1 ns) Thanks for the updated pidigits script, Victor! Maybe this is too small |
Applied, r70542 and r70547. |
Would it be possible to port the patch to python trunk? |
Hi Victor! I already applied the x_divrem patch to the trunk and to py3k. I'd prefer not to backport this to 2.6 or 3.0: it's not a new feature, |
Oops! I taught that you applied it to py3k and release30-maint :-/ It's ok, trunk and py3k is enough ;-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: