Morning HN.
Random number generation feels is a somewhat underrepresented topic in the C++ realm. There is a lot of questionable info about it found online and even the standard library is quite behind the times in terms of it's algorithms. It suffers from trying to accommodate sometimes impractical standard requirements and has several ways of getting significantly bad statistical results. This leaves a lot easily achievable performance & quality on the table.
So, being a mathematician who mostly works with stochastic models and wants these models to run fast and well, I embarked on a journey of trying to summarize "what is good and what is bad" and implement the "best stuff there currently is".
Thankfully, the design of C++
A result of this work is single-header RNG library which has:
-
Effectively all of this gets us 2x-8x speedups on many workloads while producing even better statistical quality.Don't think there is anything else like it, so I would like to showcase the result here and hear some opinions on its improvement:
https://github.com/DmitriBogdanov/UTL/blob/master/docs/modul...
For those interested, there is a more detailed rundown of all the quirks of this topic at end of the docs, might prove an interesting read.
Comments URL: https://news.ycombinator.com/item?id=44157584
Points: 26
# Comments: 7
https://github.com/DmitriBogdanov/UTL/blob/master/docs/module_random.md
Accedi per aggiungere un commento
Altri post in questo gruppo
Article URL: https://gametorch.app/collections/7
Comments URL: https://news.ycombin
Article URL: https://alloc.dev/2025/06/07/zig_optimization

Article URL: https://theedgemalaysia.com/node/758199
Comments URL: https://news