[GHC] #14103: Retypechecking the loop in --make mode is super-linear when there are many .hs-boot modules

GHC ghc-devs at haskell.org
Sun Aug 13 22:14:49 UTC 2017


#14103: Retypechecking the loop in --make mode is super-linear when there are many
.hs-boot modules
-------------------------------------+-------------------------------------
        Reporter:  duog              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:  hs-boot
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 duog):

 I think the current behaviour is correct.

 This is a complicated topic, so the explanation below is complicated, with
 lots of parenthesis!

 For the purposes of retypechecking, the loops are only used for their
 module names. There is one loop per hs-boot file. When we go to compile a
 hs file that has an hs-boot file (and therefore finishes a loop), the home
 package table has a ModDetails for this module (built from the hs-boot
 file), and all modules that transitively import that hs-boot file have
 been typechecked against that ModDetails. We retypecheck (i.e. rebuild
 their ModDetails from their interface) all those modules (but NOT the hs-
 boot modules) before typechecking the loop closer, then replace it's hs-
 boot ModDetails in the home package tables with it's full ModDetails. We
 then retypecheck the loop again, so that Ids in modules that imported the
 hs-boot module have their unfoldings attached. (although maybe this is
 wrong, see trac:14092)

 Note that it doesn't matter whether the modules we retypechecked were hs-
 boot interfaces or full hs interfaces. I think this is the key point.

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


More information about the ghc-tickets mailing list