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

Consider switching to xoroshiro128+ for RNG #37

@fatcerberus

Description

@fatcerberus

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:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions