haskell / haskell/mwc-random

Slower than System.Random?

Open
#70 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
61
Forks
27
PR merge metrics
No merged PRs in 30d

Description

I wrote a tiny utility for performing a Fisher–Yates shuffle [here](https://github.com/Boarders/perfect-vector-shuffle). 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](https://github.com/Boarders/perfect-vector-shuffle/tree/mwc-random). 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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the linked perfect-vector-shuffle utility, including its mwc-random branch, and compare its System.Random, StdGen, and mwc-random usage. Reproduce the million-integer benchmark described in the issue; done means determining whether the slowdown comes from the usage pattern or indicates a library performance problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.