Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Consider switching to xoroshiro128+ for RNG #37

Open
fatcerberus opened this issue Jun 2, 2016 · 1 comment
Open

Consider switching to xoroshiro128+ for RNG #37

fatcerberus opened this issue Jun 2, 2016 · 1 comment

Comments

@fatcerberus
Copy link

I recently switched from Mersenne Twister (MT19937) to xoroshiro128+ for random number generation in minisphere. It's about 4 times as fast as MT, generates 64-bit unsigned integers, is higher quality (i.e. passes more randomness tests), and is in the public domain. It's the successor to the xorshift128+ algorithm currently used by SpiderMonkey and V8:

The implementation I wrote for minisphere allows creating multiple generator instances as well as saving and restoring the state of the generator. Since the state is only 128-bit it can be represented as a single 32-character hex string that you can write to a file and read back later. MT19937 has nearly 2.5KB of state making it a bit unwieldy.

Here's my implementation if you want to look at it:

@saghul
Copy link
Owner

saghul commented Jun 2, 2016

Thanks for the heads up!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants