[Numpy-discussion] speed of random number generator compared to Julia

Pierre Haessig pierre.haessig at crans.org
Mon Apr 3 09:20:56 EDT 2017


Hello,

Le 30/03/2017 à 13:31, Pierre Haessig a écrit :
> [....]
>
> But how come Julia is 4-5x faster since Numpy uses C implementation
> for the entire process ? (Mersenne Twister -> uniform double ->
> Box-Muller transform to get a Gaussian
> https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/randomkit.c).
> Also I noticed that Julia uses a different algorithm (Ziggurat Method
> from Marsaglia and Tsang ,
> https://github.com/JuliaLang/julia/blob/master/base/random.jl#L700)
> but this doesn't explain the difference for uniform rng.
>
Any ideas?

Do you think Stackoverflow would be a better place for my question?

best,

Pierre

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170403/ec4575ac/attachment-0001.html>


More information about the NumPy-Discussion mailing list