Message266236
$ ./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. |
|
Date |
User |
Action |
Args |
2016-05-24 06:42:10 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, r.david.murray, ideasman42 |
2016-05-24 06:42:10 | serhiy.storchaka | set | messageid: <1464072130.78.0.404352921676.issue27096@psf.upfronthosting.co.za> |
2016-05-24 06:42:10 | serhiy.storchaka | link | issue27096 messages |
2016-05-24 06:42:10 | serhiy.storchaka | create | |
|