[erlang-questions] Mersenne Twister in Erlang

Tim Bates <>
Thu Jun 7 10:29:02 CEST 2007


Tim Bates wrote:
> roughly on a par with stdlib:random (or a bit faster) when interpreted, 
> and three times faster than stdlib:random when compiled with [native]. 
> This corresponds to 3,000,000 random numbers per second on my 2GHz 
> Athlon64. (Not to mention better quality random numbers than the 
> stdlib:random module.)

Noting the recent conversation on integer arithmetic in Erlang, I tested 
my random_mt module on my 32-bit Athlon machine and it performed 
somewhat worse than stdlib:random, similar to the reported performance 
of the MT implementation I linked in my previous post on this thread. So 
I guess my hubris was a little unwarranted as most of my improvements in 
performance came from running it on a 64-bit machine. :)

Tim.

-- 
Tim Bates




More information about the erlang-questions mailing list