Message92396
I wrote a dummy script to generate a big number (2568 decimal digits, 8530
bits) and then benchmark str(n). Results on my computer:
Python 2.7a0, Pentium4 @ 3.0 GHz (32 bits), long base=2^15
Smallest value of 5 runs:
original = 5046.8 ms
patched = 2032.4 ms
For huge numbers, the patch is much (60%) faster.
--
Small integer (type=int) : n=factorial(10) (22 bits, 7 decimal digits) with
100000 loops.
original = 861.7 ms
patched = 639.2 ms
It's also faster (26%).
--
And with n=1 (1 bit, 1 decimal digit), type=int :
original = 606.7
patched = 561.6
It's a little bit faster (7%) with the patch.
I don't see any performance regression, only good improvements: 60% faster
to huge numbers. |
|
Date |
User |
Action |
Args |
2009-09-07 23:13:03 | vstinner | set | recipients:
+ vstinner, mark.dickinson, eric.smith, gawain |
2009-09-07 23:13:03 | vstinner | set | messageid: <1252365183.35.0.251572523045.issue6713@psf.upfronthosting.co.za> |
2009-09-07 23:13:01 | vstinner | link | issue6713 messages |
2009-09-07 23:13:01 | vstinner | create | |
|