#4184: Squirrelly inliner behaviour leads to 80x slowdown
---------------------------------+------------------------------------------
    Reporter:  bos               |       Owner:                         
        Type:  bug               |      Status:  new                    
    Priority:  normal            |   Component:  Compiler               
     Version:  6.12.1            |    Keywords:                         
          Os:  Unknown/Multiple  |    Testcase:                         
Architecture:  Unknown/Multiple  |     Failure:  Runtime performance bug
---------------------------------+------------------------------------------
 Recently, I switched the mwc-random package
 (http://hackage.haskell.org/package/mwc-random) over from running in the
 ST monad to using Roman's 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/
 cd mwc-random/benchmarks
 ghc -fforce-recomp -O  -package mwc-random-0.4.1.1 --make Quickie -o
 quickie-411
 ghc -fforce-recomp -O  -package mwc-random-0.5.1.3 --make Quickie -o
 quickie-513

 time ./quickie-411
 time ./quickie-513

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4184>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to