#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
---------------------------------+------------------------------------------
Comment(by bos):
While writing the repro, I found two distinct ways to eliminate the
slowdown.
First, you can replace all uses of the {{{PrimMonad}}} class with
{{{ST}}}. If you look at the code in {{{Randomish.hs}}}, you can see that
the necessary signatures are already present, but commented out.
Alternatively, look for the comment marked {{{"{- INLINE #-}"}}} in the
same file, and turn it into a proper {{{INLINE}}} pragma. The original
{{{INLINE}}} pragma (on the local name {{{f}}}) worked with GHC 6.10 and
6.12 when I was using the plain {{{ST}}} monad, but stopped working with
6.12 when I switched to {{{PrimMonad}}}.
It seems that fragility in the inliner might be at the root of this
problem. Dan Doel notes that he saw a similar problem, and that it's
disappeared with the rewritten inliner in GHC HEAD, but this should be
useful to keep around as a historical artifact and a bulwark against
performance regressions.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4184#comment:2>
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