[Numpy-discussion] Purpose for bit-wise and'ing the initial mersenne twister key?

Michael S. Gilbert michael.s.gilbert@gmail....
Fri Feb 13 09:51:53 CST 2009


On Fri, 13 Feb 2009 16:25:37 +0100 Sturla Molden wrote:
> Honestly, I don't care about 2x differences here. How many milliseconds 
> do you save?

It's not about saving milliseconds, it's about taking half the time to
run the same simulation.  So if my runs currently take 2 hours, they
will take 1 hour instead; and if they take 2 days, they will take 1
day instead. It may not impact your application's runtime, but it does
mine.

> Projects that are speed limited by the PRNG could take the hassle to
> compile their own.

I think it would be useful for numpy to provide options and let the
user decide based on their needs (most don't want to and should not
be made to implement their own algorithms, especially since the work
has already been done).

> And if speed is that important, perhaps one should not use the Mersenne 
> Twister at all?

Just yesterday, I started looking at using /dev/urandom instead of MT,
and I had previously looked at using Marsaglia's MWC.  It's a tradeoff
between speed and random number quality.

Best Regards,
Mike


More information about the Numpy-discussion mailing list