hap.random: a new random number library for D

Joseph Rushton Wakeling via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Jun 10 23:46:46 PDT 2014


On Tuesday, 10 June 2014 at 23:48:09 UTC, bearophile wrote:
> Please stop, I am not worth that, and I don't even know how 
> much good that generator is. So for you it's better to focus on 
> more important matters of the new random module. Extra 
> generators can be added later if needed.

After all the advice and help you've given me (and the rest of 
this community) over the course of years, it's really a pleasure 
to be able to offer you a small favour like this.  But of course 
it could be fun to first run things through e.g. the TestU01 
suite ...

> Passing several cpu words by value for each generated value 
> seems not very efficient. But this generator is for special 
> situations, so a certain performance loss could be acceptable. 
> And if the compiler is able to inline the functions, the data 
> transfer overhead is removed, and most of the performance loss 
> is restored (but I don't know if non-templated Phobos functions 
> get inlined).

Well, I think it's worth experimenting with.  For clarity, I 
wasn't suggesting modifying the existing Xorshift code, but 
creating a separate implementation in strongly pure style, and 
seeing how that differs performance-wise from what already exists.

I guess I might also consider finally getting my head round 
monads, and relating that to RNG design ... :-)


More information about the Digitalmars-d-announce mailing list