Hello again
Sorry for so many messages in such a short time but I'm really enjoying playing with Julia and hope I'm not bothering you all too much. I'm wondering about the randn algorithm. In MATLAB, there is an overhead of around 40% when generating normally distributed random numbers compared to uniform. On my SandyBridge i7 running Linux, MATLAB 2012a I get
>> tic;rand(1,100000000);toc
Elapsed time is 1.443943 seconds.
>> tic;randn(1,100000000);toc
Elapsed time is 2.017200 seconds.
Now, Julia soundly beats MATLAB in the generation of uniformly distributed random numbers:
tic();a=rand(1,100000000);toc()
elapsed time: 0.3639218807220459 seconds
Almost 4 times faster! Very impressive. Your choice of SFMT has paid off here.
Moving to randn, however, and things are not so good:
tic();a=randn(1,100000000);toc()
elapsed time: 2.537461996078491 seconds
A 700% overhead compared to rand and slower than MATLAB's.
I found this difference while trying to work out why some Julia code is slower than MATLAB in a commonly used financial monte carlo simulation:
http://www.walkingrandomly.com/?p=4619It's not the whole story but definitely a factor.
Cheers,
Mike