#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 rl):
Brian, the performance of your example seems to hinge on this:
{{{
class M.Unbox a => Variate a where
uniform :: (PrimMonad m) => Gen (PrimState m) -> m a
instance Variate Double where
uniform = f where f = uniform2 wordsToDouble
{-# INLINE f #-}
{- INLINE uniform #-}
}}}
You only get good performance if you mark `uniform` as INLINE. This is
actually expected. All code parametrised over `PrimMonad` should
ultimately be inlined into a context where the monad is known. Otherwise,
GHC can't resolve and inline `(>>=)` and `return` which is very bad.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4184#comment:5>
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