[GHC] #10528: compile time performance regression with OverloadedStrings and Text

GHC ghc-devs at haskell.org
Tue Aug 4 08:34:24 UTC 2015


#10528: compile time performance regression with OverloadedStrings and Text
-------------------------------------+-------------------------------------
        Reporter:  jakewheat         |                   Owner:
            Type:  bug               |                  Status:  merge
        Priority:  high              |               Milestone:  7.10.3
       Component:  Compiler          |                 Version:  7.10.2-rc2
      Resolution:                    |                Keywords:
Operating System:  Linux             |            Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Replying to [comment:34 afarmer]:
 > I realize I could be careful about assigning phases to the inline pragma
 on `baz` and both rules, but that seems extremely fiddly compared to just
 not inlining/rewriting the RHS to begin with.

 It may be fiddly but you absolutely must do it.  In the rewrite sequence
 you give, the inlining for `baz` is active, so GHC could perfectly well
 rewrite
 {{{
 bar (baz (quux z))  --->   bar (<baz's inlining with (quux z)
 substituted>)
 }}}
 What makes you think that rule "baz-quux" will get there first?  Even if
 it usually does, some trivial thing might mean the rule missed on the
 first go, and then you'd inline `baz`.  We initially tried to guarantee
 that if rules and inlinings were both active, the rules would "win" but it
 was flaky and unreliable.  Hence phase control.

 If you want robust, predictable behaviour, you should use phases.  Sorry!
 (And then there's no reason not to inline/apply rules in the RHS.)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10528#comment:35>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list