1
0
forked from Alepha/Alepha

comment explaining the reason for use of Taus88

This commit is contained in:
2025-01-27 16:09:10 -05:00
parent d008e456c8
commit 98b3f414d4

View File

@ -13,6 +13,14 @@ namespace Alepha::Hydrogen ::detail:: fastRandom_m
struct FastRandomState
{
boost::random::taus88 fastRandomState{ std::random_device{}() };
/* The choice of Taus88 is deliberate. The more familiar Mt19937
is only slightly slower and its cousin Mt11213b is effectively
no slower, but they require 100x to 200x as many integers to
maintain state. Thus with even only one random variable, the
latter two will exceed cache line size and create cache load,
but with several/many the cache pressure will be significant and
affect performance not just for this code but for the system.
*/
std::uint32_t pool;
int remainingBits= 0;