lemire / fastrand

Fast random number generation in an interval in Python: Up to 10x faster than random.randint.
Apache License 2.0
88 stars 13 forks source link

On latest python 2.7 your library is faster #2

Closed evaldsurtans closed 7 years ago

evaldsurtans commented 7 years ago

On latest python 2.7 your library is faster

python -m timeit -s 'import fastrand' 'fastrand.pcg32bounded(1001)' 10000000 loops, best of 3: 0.0994 usec per loop

python -m timeit -s 'import numpy' 'numpy.random.randint(0, 1000)' 1000000 loops, best of 3: 1.07 usec per loop

so, I think this should be removed from readme :)

David Andersen points out that python -m timeit -s 'import numpy' 'numpy.random.randint(0, 1000)' is much faster.

lemire commented 7 years ago

Quite right.