[GHC] #13252: Perf: Make dep_finsts a map from type family Name to Module

GHC ghc-devs at haskell.org
Thu Feb 9 11:01:28 UTC 2017


#13252: Perf: Make dep_finsts a map from type family Name to Module
-------------------------------------+-------------------------------------
           Reporter:  ezyang         |             Owner:
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Today, when we do a family consistency check, we always do a pairwise
 comparison of every module, even though most of the time, the modules
 don't even define instances of the same family (making the check futile.)

 A far better strategy is to say, for any family, which modules
 transitively below us define instances for it, and only check THOSE
 pairwise. All we have to do is turn dep_finsts from a list of modules into
 a mapping from type family names to modules; then we can union the maps
 and do pairwise comparisons as before.

 Note that we want to RECORD the map from Name to Module, because we expect
 any family to have instances defined in many modules (Module to Name is
 better if a single module defines instances for many families, but clearly
 this is rare.)

 This is related to #9717, in that the proposed map here is a more coarse
 version of what was proposed in that ticket.  This may strike a happy
 compromise between keeping interface files small and speeding things up.

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


More information about the ghc-tickets mailing list