[GHC] #13639: Skylighting package compilation is glacial

GHC ghc-devs at haskell.org
Fri Aug 11 12:57:32 UTC 2017


#13639: Skylighting package compilation is glacial
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  dfeuer
            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 niteria):

 This bisects to a6e13d502ef46de854ec1babcd764ccce68c95e3, meaning that
 commit fixes the underlying problem. I cherry-picked it onto our
 `ghc-8.0.2-facebook` branch and the compile times are reasonable (~2min as
 opposed to >30m).

 I minified the original code to Skylighting.Syntax.Php.hs file that I'm
 attaching. It's boils down to a large `[Text]` list. With a commit before
 the fix there's a big blow up in the term size after one of the simplifier
 passes. After the fix the term sizes look reasonable.

 Relevant part of `-ddump-show-phases` (this is the released GHC 8.0.2, but
 the numbers are the the same before the fix):
 {{{
 !!! Parser [Skylighting.Syntax.Php]: finished in 4556.00 milliseconds,
 allocated 87.667 megabytes
 [99/1907]
 *** Renamer/typechecker [Skylighting.Syntax.Php]:
 !!! Renamer/typechecker [Skylighting.Syntax.Php]: finished in 27009.00
 milliseconds, allocated 241.752 megabytes
 *** Desugar [Skylighting.Syntax.Php]:
 Result size of Desugar (after optimization)
   = {terms: 16,197, types: 6,490, coercions: 0}
 !!! Desugar [Skylighting.Syntax.Php]: finished in 2024.00 milliseconds,
 allocated 22.967 megabytes
 *** Simplifier [Skylighting.Syntax.Php]:
 Result size of Simplifier iteration=1
   = {terms: 22,671, types: 19,426, coercions: 0}
 Result size of Simplifier
   = {terms: 22,671, types: 19,426, coercions: 0}
 !!! Simplifier [Skylighting.Syntax.Php]: finished in 14080.00
 milliseconds, allocated 150.808 megabytes
 *** Specialise [Skylighting.Syntax.Php]:
 Result size of Specialise
   = {terms: 22,678, types: 19,437, coercions: 2}
 !!! Specialise [Skylighting.Syntax.Php]: finished in 5593.00 milliseconds,
 allocated 32.625 megabytes
 *** Float out(FOS {Lam = Just 0,
                    Consts = True,
                    OverSatApps = False}) [Skylighting.Syntax.Php]:
 Result size of Float out(FOS {Lam = Just 0,
                               Consts = True,
                               OverSatApps = False})
   = {terms: 48,542, types: 58,233, coercions: 2}
 !!! Float out(FOS {Lam = Just 0,
                    Consts = True,
                    OverSatApps = False}) [Skylighting.Syntax.Php]:
 finished in 8951.00 milliseconds, allocated 126.301 megabytes
 *** Simplifier [Skylighting.Syntax.Php]:
 Result size of Simplifier iteration=1
   = {terms: 45,307, types: 55,000, coercions: 0}
 Result size of Simplifier
   = {terms: 45,307, types: 55,000, coercions: 0}
 !!! Simplifier [Skylighting.Syntax.Php]: finished in 36008.00
 milliseconds, allocated 394.685 megabytes
 *** Simplifier [Skylighting.Syntax.Php]:
 Result size of Simplifier iteration=1
   = {terms: 55,006, types: 55,000, coercions: 0}
 Result size of Simplifier
   = {terms: 42,074, types: 22,670, coercions: 0}
 !!! Simplifier [Skylighting.Syntax.Php]: finished in 44152.00
 milliseconds, allocated 564.940 megabytes
 *** Simplifier [Skylighting.Syntax.Php]:
 Result size of Simplifier iteration=1
   = {terms: 1,060,469, types: 775,959, coercions: 193,980}
 Result size of Simplifier iteration=2
   = {terms: 944,081, types: 824,454, coercions: 171,349}
 Result size of Simplifier iteration=3
   = {terms: 827,693, types: 624,008, coercions: 38,796}
 Result size of Simplifier iteration=4
 }}}

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


More information about the ghc-tickets mailing list