#14610: newtype wrapping of a monadic stack kills performance -------------------------------------+------------------------------------- Reporter: mrkkrp | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata):
So it looks like newtype wrapping reduces GHC's ability to create join points SPJ talked about recently.
Without looking at the code: This is a good guess. `foo x = if … then foo (x+1) else …` is a tail call (and hence allows `foo` to be a join point) while `foo x = if … then foo (x+1) `cast` coercion … else …` is not. But (from an operational point of view) it could well be! But someone would have to produce a minimal example to be sure this is really the issue. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14610#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler