Serhiy Storchaka added the comment:

$ ./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.

----------
assignee:  -> rhettinger
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27096>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to