[Issue 6594] Xorshift as default generator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 5 07:41:12 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=6594


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #2 from monarchdodra at gmail.com 2013-07-05 07:41:11 PDT ---
MersenneTwister is supposed to be fast though...

I think the problem could have something to do with the whole "PRNG value
semantic" fiasco:

pragma(msg, Mt19937.sizeof);  //2504u
pragma(msg, Xorshift.sizeof); //16u

The mersenne twister range has a size of 2.5 KB (!)

The performance penalty most probably comes from passing it (by value) to
algorithms or whatnot.

I know for a fact this *will* cause significant slowdown. I observed this while
implementing a Lagged Fibonacci PRNG, whose size varies a lot. The bigger
flavors of the PRNG would make the runtime grind to a halt, while the biggest
versions simply stack overflowed.

----
All this to say, I think it is not the algorithm of mersenne itself that is
slow, but rather the range implementation. Until this is fixed, we *may* want
to change the default.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list