From 98b3f414d44708b3afbbec1394eaf8d6e4debef2 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 27 Jan 2025 16:09:10 -0500 Subject: [PATCH] comment explaining the reason for use of Taus88 --- fastRandom.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fastRandom.cc b/fastRandom.cc index 8e01c24..f9e2494 100644 --- a/fastRandom.cc +++ b/fastRandom.cc @@ -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;