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 serhiy.storchaka
Recipients mark.dickinson, rhettinger, serhiy.storchaka
Date 2012-12-13.20:54:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355432076.17.0.54183868892.issue16674@psf.upfronthosting.co.za>
In-reply-to
Content
The proposed patch adds a fast patch for generating small integers (the most common use case).

Microbenchmark:
$ ./python -m timeit -s "import random; r=random.getrandbits; n=30"  "r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n)"

Non patched: 4.27 usec per loop
Patched: 2.97 usec per loop
History
Date User Action Args
2012-12-13 20:54:36serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, mark.dickinson
2012-12-13 20:54:36serhiy.storchakasetmessageid: <1355432076.17.0.54183868892.issue16674@psf.upfronthosting.co.za>
2012-12-13 20:54:35serhiy.storchakalinkissue16674 messages
2012-12-13 20:54:35serhiy.storchakacreate