[GHC] #14899: Significant compilation time regression between 8.4 and HEAD due to coverage checking

GHC ghc-devs at haskell.org
Wed Mar 7 21:08:36 UTC 2018


#14899: Significant compilation time regression between 8.4 and HEAD due to
coverage checking
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.5
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 This is bad. Really bad.

 I looked briefly into the GHC source, and found
 [http://git.haskell.org/ghc.git/blob/d9d463289fe20316cff12a8f0dbf414db678fa72:/compiler/deSugar/Check.hs#l1105
 this ominous Note]:

 {{{
 Note [Translate CoPats]
 ~~~~~~~~~~~~~~~~~~~~~~~
 The pattern match checker did not know how to handle coerced patterns
 `CoPat`
 efficiently, which gave rise to #11276. The original approach translated
 `CoPat`s:

     pat |> co    ===>    x (pat <- (e |> co))

 Instead, we now check whether the coercion is a hole or if it is just
 refl, in
 which case we can drop it. Unfortunately, data families generate useful
 coercions so guards are still generated in these cases and checking data
 families is not really efficient.
 }}}

 If that is to be believed, then is coverage-checking data family instances
 really doomed to be slow?

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


More information about the ghc-tickets mailing list