Massive slowdown in mwc-random after switching to use of primitive
bos at serpentine.com
Sat Jul 10 14:09:48 EDT 2010
Hi, Roman —
Recently, I switched the mwc-random package (
http://hackage.haskell.org/package/mwc-random) over from running in the ST
monad to using your primitive package. I didn't notice initially, but this
caused a huge performance regression.
mwc-random 0.4.1.1 uses ST internally, and runs the benchmarks/Quickie
benchmark in 0.017 seconds.
mwc-random 0.5.1.3 uses PrimMonad internally, and takes 1.328 seconds to run
the same benchmark.
That's about a factor of 80 slowdown. This causes a massive knock-on
performance loss in packages such as criterion that need fast PRNGs.
The problem is very easy to reproduce:
cabal install mwc-random-0.4.1.1
cabal install mwc-random-0.5.1.3
darcs get http://darcs.serpentine.com/mwc-random/
ghc -fforce-recomp -O -package mwc-random-0.4.1.1 --make Quickie -o
ghc -fforce-recomp -O -package mwc-random-0.5.1.3 --make Quickie -o
If you could shed any light, I'd be most grateful, as this has me a bit
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users