C# (CSharp) Redzen.Numerics XorShiftRandom.NextBytes8 - 1 examples found. These are the top rated real world C# (CSharp) examples of Redzen.Numerics.XorShiftRandom.NextBytes8 extracted from open source projects. You can rate examples to help us improve the quality of examples.
A version of NextBytes that uses a pointer to set 4 bytes of the byte buffer in one operation thus providing a nice speedup. The loop is also partially unrolled to allow out-of-order-execution, this results in about a x3 speedup on an Intel Core i7 920 (Bloomfield). Thus performance may vary wildly on different CPUs depending on the number of execution units available. Another significant speedup is obtained by setting the 4 bytes by indexing pDWord (e.g. pDWord[i++]=_w) instead of dereferencing it (e.g. *pDWord++=_w). Note that this routine requires the unsafe compilation flag to be specified and so is commented out by default.