[GHC] #12234: 'deriving Eq' on recursive datatype makes ghc eat a lot of CPU and RAM

GHC ghc-devs at haskell.org
Sun Jun 26 14:18:56 UTC 2016


#12234: 'deriving Eq' on recursive datatype makes ghc eat a lot of CPU and RAM
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 Nice find. Here is some stats:

 {{{
 =========================================Bug=========================================
 CodeGen                                 19976.00 ms  40880.83 mb  62.9% of
 total time
 Simplifier (7)                          10302.00 ms   9418.43 mb  32.4% of
 total time
 CorePrep                                  762.00 ms    323.56 mb   2.4% of
 total time
 CoreTidy                                  469.00 ms    274.51 mb   1.5% of
 total time
 Common sub-expression                      87.00 ms     60.19 mb   0.3% of
 total time
 Float inwards (2)                          81.00 ms     51.34 mb   0.3% of
 total time
 Renamer/typechecker                        47.00 ms     44.12 mb   0.1% of
 total time
 Demand analysis                            21.00 ms     19.45 mb   0.1% of
 total time
 Worker Wrapper binds                        3.00 ms      1.89 mb   0.0% of
 total time
 Parser                                      2.00 ms      0.50 mb   0.0% of
 total time
 Specialise                                  0.00 ms      0.23 mb   0.0% of
 total time
 Desugar                                     0.00 ms      0.65 mb   0.0% of
 total time
 Called arity analysis                       0.00 ms      0.82 mb   0.0% of
 total time
 -------------------------------------------------------------------------------------
 Total                                   31750.00 ms  51076.53 mb 100.0% of
 total time

 ======================Total======================
 CodeGen                                    62.92%
 Simplifier                                 32.45%
 CorePrep                                    2.40%
 CoreTidy                                    1.48%
 Common sub-expression                       0.27%
 Float inwards                               0.26%
 Renamer/typechecker                         0.15%
 Demand analysis                             0.07%
 Worker Wrapper binds                        0.01%
 Parser                                      0.01%
 Specialise                                  0.00%
 Desugar                                     0.00%
 Called arity analysis                       0.00%
 }}}

 Simplifier is running 7 times! More interestingly, I wanted to have a look
 at
 Core and STG, and tried -ddump-simpl. It took about 5 minutes until I
 killed
 the process and realized that generated incomplete Core output is 664M
 already

 {{{
 -rw-r--r--   1 omer users 664M Jun 26 14:18 Bug1.dump-simpl
 }}}

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


More information about the ghc-tickets mailing list