[Haskell-cafe] Efficient functional idiom for histogram

Anton van Straaten anton at appsolutions.com
Sat Aug 1 15:40:40 EDT 2009

Sterling Clover wrote:
> For other random numbers, with different properties (faster, but with 
> tradeoffs in robustness, or ability to split, or both), you can check 
> hackage for at least mersenne-random and gsl-random.

gsl-random is definitely worth a try for performance.  I recently did a 
rough benchmark (not rigorous) of Control.Monad.Random, which uses 
System.Random, and Control.Monad.MC, which uses GSL.Random. 
Control.Monad.Random took about 3.6 times longer to generate a few 
million random numbers compared to Control.Monad.MC, and used five times 
as much heap.  The GSL-based version generated about 340,000 random 
numbers per second on a 1.8GHz notebook.


More information about the Haskell-Cafe mailing list