[GHC] #14594: 2 modules / 2500LOC takes nearly 3 minutes to build

GHC ghc-devs at haskell.org
Mon Jan 29 16:09:25 UTC 2018


#14594: 2 modules / 2500LOC takes nearly 3 minutes to build
-------------------------------------+-------------------------------------
        Reporter:  schyler           |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 I tried generating a bunch of modules with derived data instances. A
 module with 29 single-field instances desugars to 5201 terms, 13488 types,
 145 coercions. This is a similar number of terms as `Data.Set.Internal`,
 but about twice as many types.

 Core tidy is 11,705 terms, 21,960 types, and 1,479 coercions.

 GHC allocates 2,222,336,112 bytes compiling this compared to 1,663,610,072
 for compiling `Data.Set.Internal`.

 I also noticed that there's actually a strong non-linearity at the low
 end: types with small umbers of fields have high incremental costs. For 50
 definitions, using 0,1,2,3, and 4 fields each, I get 2.49, 3.85, 4.92,
 5.51 and 5.66 GB of GHC allocation, respectively. I need to explore this a
 bit more.

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


More information about the ghc-tickets mailing list