3 ms·
There are things with rand() like performance but much better properties. for randomized search I'm a fan of xoshiro256++ periodically reseeded by rdrand. Obv
by nullc 3y ago
There are things with rand() like performance but much better properties.
for randomized search I'm a fan of xoshiro256++ periodically reseeded by rdrand.
Obviously if performance isn't a concern, a CSPRNG should be the default. But it often is a concern.
Traditional 'fast' PRNGs have simple algebraic structure that is absolutely known to cause wrong results, they're not worth it compared to modern fast PRNGs.
(I wouldn't ever use MT today, it's not on the pareto-frontier of performance vs quality and has a bad cache footprint)
> tl;dr: maybe "Need a PRNG? Start with one that's cryptographically secure"?
I agree but: I think if people do that, they'll often find that their whole process is now 20% slower than when they used rand() and then go back to rand. So I think it's also important to make people aware of fast generators with better properties.