[GHC] #9630: compile-time performance regression (probably due to Generics)

GHC ghc-devs at haskell.org
Fri Jun 16 19:10:07 UTC 2017


#9630: compile-time performance regression (probably due to Generics)
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  7.9
      Resolution:                    |             Keywords:  deriving-
                                     |  perf, Generics
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #9583, #10293,    |  Differential Rev(s):
  #13059, #10818                     |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Hmmmm... While  2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19 seems to improve
 matters considerably, it doesn't fix the whole issue. ezyang's
 reproduction in comment:22 can be modified to make things blow up after
 the commit, and as far back as 7.8 at least. Specifically:

 * Increase the size of the definition of `T`, leaving it in the `Gen`
 module.

 * Move the definition of `tput` to a separate `GenSpec` module.

 This will lead to simplifier tick exhaustion. If the definition of `T` (or
 even just the derivation of `Generic T`) is moved to `GenSpec`, then
 compilation succeeds.

 The number of terms seems to blow up several simplifier passes after
 specialization. I don't yet know why, but it smells like inlining.

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


More information about the ghc-tickets mailing list