[GHC] #9233: Compiler performance regression

GHC ghc-devs at haskell.org
Mon Jul 7 21:53:55 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):

 Lennart's program seems to be hitting a strange behavior in the
 simplifier. I managed to extract a relatively simple test case on which
 ghc 7.8 is much slower than 7.6. With `-v3` I see output like this (may be
 for a slightly different version):
 {{{
 ...
 *** Demand analysis:
 Result size of Demand analysis
   = {terms: 274, types: 282, coercions: 3}
 *** Worker Wrapper binds:
 Result size of Worker Wrapper binds
   = {terms: 642, types: 692, coercions: 3}
 *** Simplifier:
 Result size of Simplifier iteration=1
   = {terms: 519, types: 669, coercions: 556}     <---- !!!
 Result size of Simplifier iteration=2
   = {terms: 285, types: 329, coercions: 3}
 Result size of Simplifier = {terms: 285, types: 329, coercions: 3}
 ...
 }}}

 The program is sensitive to changes in various ways. Doubling the number
 of fields in `X` doubles the number of coercions on that line, and
 increases ghc's runtime by a factor of about 16. Reducing the number of
 fields in `Options` to ten or fewer eliminates this spike in coercions
 completely! And changing `" "` to `""` eliminates the excess conversions,
 too.

 My laziness change to Pair seems to only help in this pathological case,
 and it slightly hurts on any other program I have tried. So better to
 track down and avoid this bad behavior in the simplifier, and leave
 `coercionKind` and friends alone, I think.

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


More information about the ghc-tickets mailing list