[GHC] #8095: TypeFamilies painfully slow

GHC ghc-devs at haskell.org
Tue Feb 12 04:09:28 UTC 2019


#8095: TypeFamilies painfully slow
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.8.1
       Component:  Compiler (Type    |              Version:  7.6.3
  checker)                           |
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #5321, #11598,    |  Differential Rev(s):  Phab:D3752,
  #12506, #13386                     |  Phab:D4766
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by pingu):

 Replying to [comment:58 hussein.aitlahcen]:
 > Hello everyone,
 >
 > My team experienced the same issue when using Squeal extensively
 (https://github.com/morphismtech/squeal).

 My team appears to be experiencing the same issue using Beam migrations.
 Beam is a similar library to Squeal which makes heavy use of type families
 (https://tathougies.github.io/beam/)...

 I found this ticket whilst trying to work out why GHC was spending so much
 time and memory simplifying.

 > ... Because of that, GHC was taking **12gb+** to compile some files. I
 found that omitting the interfaces pragmas with `-fomit-interface-pragmas`
 was helping a lot. In fact, no more unfolded type in the interface file,
 making the dumped .txt file going from **3.5gb** to **700kb** with a
 maximum allocated memory of **2.5gb**.

 This flag reduced our maximum residency from ~= 14GB down to ~= 10GB, and
 compile times roughly halved. Thank you very much for this tip, it's
 stopped us swapping during compilation for now.

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


More information about the ghc-tickets mailing list