Friday, January 29, 2016

[tnkmjbjx] Many random numbers

Any API for pseudorandom number generation should provide a means to obtain a bunch of random numbers all at once, instead of having to make multiple calls to the function.  Often random numbers are needed in tuples for coordinates, or a huge number of them for simulation.  Providing many random numbers at once may be more efficient, especially since some RNGs internally generate a bunch at a time.

Alternatively, keep the API returning only one random number at time, but allow powerful and deep code transformation tools to restructure the client code to interleave efficiently with the random number generation, e.g., instruction pipelining.  Inlining every call and unrolling loops may work.

No comments :