[GHC] #15164: Slowdown in ghc compile times from GHC 8.0.2 to GHC 8.2.1 when doing Called arity analysis

GHC ghc-devs at haskell.org
Fri May 18 14:08:12 UTC 2018


#15164: Slowdown in ghc compile times from GHC 8.0.2 to GHC 8.2.1 when doing Called
arity analysis
-------------------------------------+-------------------------------------
           Reporter:  flip101        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  highest        |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Linux
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  performance bug
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Hello,

 I have this program that compiles against packages of stack LTS-9.21. When
 i compile with GHC 8.0.2 (version of LTS-9.21) the compiling is fast.

 72.01user 34.61system 0:52.98elapsed 201%CPU (0avgtext+0avgdata
 600684maxresident)k

 When i upgrade to LTS-11.9 compiling gets slow. To test if it was a
 problem with new package or GHC (ghc gives some new packages too) i ran:

 /usr/bin/time stack build --compiler ghc-8.2.1 --ghc-options="-v3 -j4 -O2
 -fexcess-precision -optc-O3 -optc-ffast-math -rtsopts=none -no-rtsopts-
 suggestions"

 with the old package of LTS-9.21 but with the newer GHC 8.2.1 compiler.
 Now the compile times are much higher:

 2481.26user 663.66system 35:38.82elapsed 147%CPU (0avgtext+0avgdata
 674732maxresident)k

 I already took out parts of the grammar to get it even to compile. When i
 have the full grammar i can let my laptop compile 24 hours and it's still
 busy.

 I was not sure how to further reduce the code. Maybe when a lot of effort
 i can cut out a few lines here and there. So i uploaded the entire project
 here https://github.com/flip111/parser-calledarityanalysis i already took
 out a lot of code. If anyone has suggestions on how to further reduce the
 code i can try.

 Because i had debug info on (-v3 flag) i saw it was stuck for a long time
 at "Called arity analysis"

 I prioritize this bug high because i think the slowdown is very
 problematic.

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


More information about the ghc-tickets mailing list