This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eric.smith, gawain, mark.dickinson, vstinner
Date 2009-09-07.23:13:01
SpamBayes Score 3.5422485e-07
Marked as misclassified No
Message-id <1252365183.35.0.251572523045.issue6713@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-09-07 23:13:03vstinnersetrecipients: + vstinner, mark.dickinson, eric.smith, gawain
2009-09-07 23:13:03vstinnersetmessageid: <1252365183.35.0.251572523045.issue6713@psf.upfronthosting.co.za>
2009-09-07 23:13:01vstinnerlinkissue6713 messages
2009-09-07 23:13:01vstinnercreate