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 ideasman42, r.david.murray, rhettinger, serhiy.storchaka
Date 2016-05-24.06:42:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464072130.78.0.404352921676.issue27096@psf.upfronthosting.co.za>
In-reply-to
Content
$ ./python -m timeit -s 'from os import urandom' 'urandom(1000000)'
10 loops, best of 3: 132 msec per loop
$ ./python -m timeit -s 'from random import getrandbits' 'n = 1000000; getrandbits(n*8).to_bytes(n, "little")'
100 loops, best of 3: 14.1 msec per loop

With the purposed method this can be up to 3.4 times faster, but as I said in issue27072, I don't think API growing is worth the benefit.
History
Date User Action Args
2016-05-24 06:42:10serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, r.david.murray, ideasman42
2016-05-24 06:42:10serhiy.storchakasetmessageid: <1464072130.78.0.404352921676.issue27096@psf.upfronthosting.co.za>
2016-05-24 06:42:10serhiy.storchakalinkissue27096 messages
2016-05-24 06:42:10serhiy.storchakacreate