[GHC] #9233: Compiler performance regression
GHC
ghc-devs at haskell.org
Mon Jul 7 02:45:05 UTC 2014
#9233: Compiler performance regression
---------------------------------+------------------------------------
Reporter: augustss | Owner:
Type: bug | Status: new
Priority: low | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Windows | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------+------------------------------------
Comment (by rwbarton):
I profiled GHC and ran it on Lennart's sample code. It spent quite a lot
of time, 23.4% in `coercionKind.go`. Further investigation seemed to
indicate that most of that time was spent in the `TyConAppCo` case, when
called from `coercionRole`. I made the Functor and Applicative (and other)
instances of `Pair` lazy in the pair, trying to avoid traversing the
entire coercion when we only need the outermost type constructor. It did
speed up the compilation significantly, from 25 seconds to 18 seconds:
{{{
# current HEAD
<<ghc: 81626230952 bytes, 3494 GCs, 71837424/232400704 avg/max bytes
residency (28 samples), 591M in use, 0.00 INIT (0.00 elapsed), 17.98 MUT
(18.23 elapsed), 6.38 GC (6.38 elapsed) :ghc>>
# with lazy Pair instances
<<ghc: 42510020272 bytes, 2493 GCs, 71633789/232686656 avg/max bytes
residency (28 samples), 591M in use, 0.00 INIT (0.00 elapsed), 12.00 MUT
(12.26 elapsed), 6.06 GC (6.06 elapsed) :ghc>>
}}}
However, it had almost no effect on compile allocations for any program in
nofib. Perhaps the bad behavior is triggered by large list or record
literals.
There must be other regressions, since 7.6.3 takes only 9 seconds on my
system. Also, I note that the object files produced by 7.8 or HEAD for
Flags and Options are about 25% larger than those produced by 7.6.3.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9233#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list