-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use faster XOR shift RNG. #9
base: main
Are you sure you want to change the base?
Conversation
Yeah that's definitely something to consider, I might run some experiments tomorrow to see what settings might make sense. I would aim for a runtime of ~20 seconds as reasonable for the fastest program? |
Sorry I've been a bit slow at working on this recently, I've just restarted my uni term and I'm in doing a game jam with some friends so it might be a bit until I've finished this PR. |
@tritoke Don't worry, there is no deadline for this research project :) |
So I have finally gotten round to adding kotlin, csharp and javascript versions. Other than that, I haven't changed the parameters of the main runs, and the random number generator tests all run between 2 and 5 seconds, with javascript taking more than 9 minutes on my machine... I did find a xorshift128+ generator for javascript which took ~30 seconds to run the test, but that is still far, far slower than the others 🤷 Other PRNGs that seemed interesting to me in my research were the xoshiro and xoroshiro family of generators. |
This pull request is to show how moving to a more traditional xorshift RNG can result in
massive speedups as well as more consistent results across languages as it doesn't depend on floating point implementations,
only on having a 64 bit int type with some bit-shifting operations.
This initial commit contains two new java files and 2 new C files. One benchmark each for the RNG, and another for the full system using the faster RNG.
The actual RNG implemented is xorshift*.
I'm going to add more languages to this pull request as and when I can.