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

GHC ghc-devs at haskell.org
Mon Jun 5 14:53:04 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):

 Replying to [comment:59 simonpj]:
 > I can see that you get two copies of the same code, which CSE will
 presumably get rid of.  That might be worth trying to fix.
 >
 > But why does it lead to a 26x increase in compilation time? I'd expect
 it to be un-noticeable.

 Well, it's not always going to cause serious problems, and I think this
 ticket touches several underlying issues, but it bet it ''can'' cause
 serious trouble. Suppose you have a class with ten methods, and use
 generic defaults. Now you'll end up with ten dictionaries of ten methods
 each. Depending on how inlining goes, I suspect that could be quite bad.

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


More information about the ghc-tickets mailing list