-
Notifications
You must be signed in to change notification settings - Fork 25
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
Slower than System.Random? #70
Comments
I only glanced at code. I can't see anything obviously wrong but I suspect that problem is lack of specialization. You could try to add |
Here's a simplistic benchmark: BenchShuffle.zip. random-1.1
mwc-random-0.14.0.0
and for comparison tf-random-0.5:
|
@Shimuuar : Adding INLINE, SPECIALISE, INLINEABLE and the ghc-options -fexpose-all-unfoldings |
I tried to reproduce issue and wasn't able to build reproducer. Is this still actual? |
I wrote a tiny utility for performing a Fisher–Yates shuffle here. At first I wrote this using System.Random and StdGen but was informed this was supposedly extremely slow. I then updated to use this library here. Surprisingly this led to worse performance on every experiment that I ran. Is this the wrong use case for this library (e.g. generating a million Ints between from i to 1000000 as i goes from 1 to 999999)? Or am I doing something else wrong? I did make sure to only generate a single generator but I am not very informed about the ins-and-outs of RNG and so this might simply be an inappropriate use case.
The text was updated successfully, but these errors were encountered: