[GHC] #13253: Exponential compilation time with RWST & ReaderT stack with `-02`

GHC ghc-devs at haskell.org
Mon Oct 22 10:49:45 UTC 2018


#13253: Exponential compilation time with RWST & ReaderT stack with `-02`
-------------------------------------+-------------------------------------
        Reporter:  phadej            |                Owner:  bgamari, osa1
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15630            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 I did try (1), but failed. A naive attempt at "simply" stopping the
 recursion leads to core lint errors, causing uniques to escape their
 scope. AFAICT this has to do with how the specialiser mixes the "gather
 usages", "generate uniques" and "specialise" concerns.

 Unfortunately, the particular code that does this (`scExpr`) doesn't come
 with sufficient documentation, and I can't seem to figure out how to do it
 properly - it's not even clear to me what "do nothing" should look like in
 the context of `scExpr` - `return (nullUsage, e)`, as I originally
 expected, is certainly not it.

 Also, it looks like there is a recursion counter of sorts, `sc_count`, in
 place already (or rather, a counter that calculates the number of
 specialisations), but it doesn't seem to be effective in this particular
 case.

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


More information about the ghc-tickets mailing list