[GHC] #7258: Compiling DynFlags is jolly slow

GHC ghc-devs at haskell.org
Fri Nov 3 08:58:18 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):

 Stg2Stg turns out to b a dead end. The performance loss I observed there
 is entirely due to formatting and dumping about 1.3 GiB worth of STG when
 compiling with -ddump-stg; when compiling without -ddump-stg, `Stg2Stg`
 doesn't show up in the profile at all (0.0 on everything).

 Re-running the profiling script without dumps shows different culprits:
 `tryToInline`, and `simpl_bind`. E.g. 400-field `read`:

 {{{
         Fri Nov  3 08:43 2017 Time and Allocation Profiling Report
 (Final)

            ghc-stage2 +RTS -p -h -RTS -B/home/tobias/well-
 typed/devel/ghc/inplace/lib -B/home/tobias/well-
 typed/devel/ghc/inplace/lib -O -fforce-recomp -c generated/t-400-read.hs

         total time  =       59.05 secs   (59049 ticks @ 1000 us, 1
 processor)
         total alloc = 75,366,446,544 bytes  (excludes profiling overheads)

 COST CENTRE                    MODULE     SRC
 %time %alloc

 simpl_bind                     Simplify
 compiler/simplCore/Simplify.hs:141:83-101            29.4   22.0
 tryToInline                    CmmSink    compiler/cmm/CmmSink.hs:410:3-41
 24.4   32.4
 RegAlloc-linear                AsmCodeGen
 compiler/nativeGen/AsmCodeGen.hs:(658,27)-(660,55)   10.6   14.1
 FloatOutwards                  SimplCore
 compiler/simplCore/SimplCore.hs:471:40-66             8.8    6.9
 pprNativeCode                  AsmCodeGen
 compiler/nativeGen/AsmCodeGen.hs:(529,37)-(530,65)    4.0    4.7
 OccAnal                        SimplCore
 compiler/simplCore/SimplCore.hs:(739,22)-(740,67)     2.3    2.2
 StgCmm                         HscMain
 compiler/main/HscMain.hs:(1426,13)-(1427,62)          2.1    1.8
 regLiveness                    AsmCodeGen
 compiler/nativeGen/AsmCodeGen.hs:(591,17)-(593,52)    1.9    1.3
 NativeCodeGen                  CodeOutput
 compiler/main/CodeOutput.hs:171:18-78                 1.5    1.6
 genMachCode                    AsmCodeGen
 compiler/nativeGen/AsmCodeGen.hs:(580,17)-(582,62)    1.4    1.3
 CoreTidy                       HscMain
 compiler/main/HscMain.hs:1253:27-67                   1.3    1.4
 dmdAnal'-Case-single_prod_ctor DmdAnal
 compiler/stranal/DmdAnal.hs:(251,5)-(276,68)          1.3    1.5
 }}}

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


More information about the ghc-tickets mailing list