[GHC] #9198: large performance regression in type checker speed in 7.8

GHC ghc-devs at haskell.org
Mon Jun 16 22:59:47 UTC 2014


#9198: large performance regression in type checker speed in 7.8
-------------------------------------------------+-------------------------
        Reporter:  carter                        |            Owner:
            Type:  bug                           |           Status:  new
        Priority:  high                          |        Milestone:
       Component:  Compiler (Type checker)       |          Version:  7.8.2
      Resolution:                                |         Keywords:
Operating System:  Unknown/Multiple              |     Architecture:
 Type of failure:  Compile-time performance bug  |  Unknown/Multiple
       Test Case:                                |       Difficulty:
        Blocking:                                |  Unknown
                                                 |       Blocked By:
                                                 |  Related Tickets:
-------------------------------------------------+-------------------------

Comment (by simonpj):

 The types really do get twice as large each time you add an `a`, I think.
 Are you certain that 7.6 is really fast?  It got slow for me, just as 7.8
 does, and not surprisingly so.

 These "big type" examples are pretty rare in practice, but even basic old
 Hindley-Milner type inference is worst-case exponential in program size.

 That said, GHC makes it worse by dragging these large type right through
 the compiler pipeline; it's a price we pay for a properly typed
 intermediate language.  See [http://research.microsoft.com/en-
 us/um/people/simonpj/papers/variant-f/index.htm Scrap your type
 applications] for a way to improve these bad cases -- at a cost in
 compiler code complexity.

 Simon

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


More information about the ghc-tickets mailing list