Comparing 32bit and 64bit performance on low end micro-controllers
Testing 32bit vs 64bit PRNGs on a 32bit ESP32-C3 I'm seeing:
PRNG | Iterations per second | Output Bits | Bytes per second |
---|---|---|---|
pcg32 | 487802 | 32 | 1951266.7 b/s |
xoroshiro64** | 516023 | 32 | 2050966.7 b/s |
xoshiro256+ | 487808 | 64 | 3878726.7 b/s |
xoshiro512++ | 441735 | 64 | 3514373.3 b/s |
splitmix64 | 462290 | 64 | 3677033.3 b/s |
pcg64 | 416297 | 64 | 3313060.0 b/s |
Very little difference on PRNGs that use 64bit operations vs 32bit operations. Even on limited hardware like this it makes sense to use a 64bit PRNG because you get more bytes per cycle.