[GHC] #7258: Compiling DynFlags is jolly slow

GHC ghc-devs at haskell.org
Mon Nov 20 16:08:41 UTC 2017


#7258: Compiling DynFlags is jolly slow
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  simonpj
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.6.1
      Resolution:                    |             Keywords:  deriving-perf
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 Progress made so far:

 - Reduced algorithmic complexity in register spilling ([comment:33])
 - Minor improvements in the pretty-based code writer ([comment:34])
 - Refactored generated `Read` code (comment [comment:37] / ticket
 [ticket:14364])
 - Observed that `Read` instances generate long chains of monadic binds
 over a monad that introduces nested closures when binding (`ReadP`,
 specifically); and that deeply nested closures in general cause the
 register allocator to repeatedly unpack and re-pack free variables, which
 leads to quadratic behavior. The fix for this has been split off into
 [ticket:14461].

 Things left to do:

 - Replace `pretty` with something that doesn't share its nonlinearities
 ([ticket:14005])
 - Once [ticket:14461] is done, it may be worth digging further; right now,
 the nested-closures nonlinearity makes it difficult to isolate other
 bottlenecks though.

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


More information about the ghc-tickets mailing list