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

GHC ghc-devs at haskell.org
Sun Jan 21 08:25:13 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.4.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:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 ManyConstructors outputs are exactly the same with and without this patch,
 so any changes in the stats should be because of the compiler itself doing
 the same work more or less efficiently.

 In T13056 there's only a small difference, with this patch there's this
 join point:

 {{{
 join {
   ds1_s5PK [Dmd=<L,1*U>] :: base-4.11.0.0:Data.Semigroup.Internal.Any
   [LclId[JoinId(0)]]
   ds1_s5PK = jump go_a5kA ys_a5kH }
 }}}

 this is inlined without this patch. I doubt this will make any difference
 though because this is just a single jump.

 So to answer

 > Are those perf/compiler improvements happening because (a) GHC is
 generating less code of (b) GHC's code is running faster?

 I think these are because GHC's code is running faster.

 FWIW, on my laptop this patch does not cause any perf failures. When I
 look at the stats files for these two tests I see that with this patch GHC
 allocates less in T13056 but more in ManyConstructors (just a few MB
 difference). Other stats differ (sometimes better with this patch,
 sometimes worse) but only very small amounts. Overall I don't get any perf
 failures.

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


More information about the ghc-tickets mailing list