[GHC] #15418: Performance drop 60 times on non-profiling binary

GHC ghc-devs at haskell.org
Wed Aug 29 23:38:04 UTC 2018


#15418: Performance drop 60 times on non-profiling binary
-------------------------------------+-------------------------------------
        Reporter:  hth313            |                Owner:  (none)
            Type:  bug               |               Status:  infoneeded
        Priority:  high              |            Milestone:  8.8.1
       Component:  Runtime System    |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  MacOS X           |         Architecture:  x86_64
 Type of failure:  Runtime           |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14414, #9599     |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by hth313):

 Here are the numbers for different optimization level (no profiling
 enabled).

 == `-O0`
 {{{
 15,092,192,977,712 bytes allocated in the heap
  108,592,404,512 bytes copied during GC
      186,703,440 bytes maximum residency (1432 sample(s))
          709,040 bytes maximum slop
              451 MB total memory in use (0 MB lost due to fragmentation)

                                      Tot time (elapsed)  Avg pause  Max
 pause
   Gen  0     13967958 colls,     0 par   301.484s  311.887s     0.0000s
 0.0044s
   Gen  1      1432 colls,     0 par   100.350s  100.731s     0.0703s
 0.2282s

   INIT    time    0.000s  (  0.002s elapsed)
   MUT     time  2260.896s  (2283.741s elapsed)
   GC      time  401.834s  (412.618s elapsed)
   EXIT    time    0.000s  (  0.002s elapsed)
   Total   time  2662.730s  (2696.363s elapsed)

   %GC     time      15.1%  (15.3% elapsed)

   Alloc rate    6,675,314,555 bytes per MUT second

   Productivity  84.9% of total user, 84.7% of total elapsed


 real    44m56.321s
 user    44m22.736s
 sys     0m31.989s
 }}}


 == `-O1`
 {{{
 2,608,631,901,600 bytes allocated in the heap
    6,337,722,720 bytes copied during GC
       80,513,992 bytes maximum residency (61 sample(s))
          434,080 bytes maximum slop
              235 MB total memory in use (0 MB lost due to fragmentation)

                                      Tot time (elapsed)  Avg pause  Max
 pause
   Gen  0     1993189 colls,     0 par   43.959s  45.610s     0.0000s
 0.0021s
   Gen  1        61 colls,     0 par    2.810s   2.938s     0.0482s
 0.1433s

   INIT    time    0.000s  (  0.002s elapsed)
   MUT     time  835.425s  (843.204s elapsed)
   GC      time   46.769s  ( 48.548s elapsed)
   EXIT    time    0.000s  (  0.001s elapsed)
   Total   time  882.194s  (891.755s elapsed)

   %GC     time       5.3%  (5.4% elapsed)

   Alloc rate    3,122,521,195 bytes per MUT second

   Productivity  94.7% of total user, 94.6% of total elapsed


 real    14m51.787s
 user    14m42.200s
 sys     0m7.372s
 }}}


 == `-O2`

 {{{
 2,608,768,497,856 bytes allocated in the heap
    6,313,467,672 bytes copied during GC
       80,449,120 bytes maximum residency (62 sample(s))
          487,840 bytes maximum slop
              235 MB total memory in use (0 MB lost due to fragmentation)

                                      Tot time (elapsed)  Avg pause  Max
 pause
   Gen  0     1993104 colls,     0 par   47.643s  49.406s     0.0000s
 0.0017s
   Gen  1        62 colls,     0 par    2.746s   2.880s     0.0465s
 0.1499s

   INIT    time    0.000s  (  0.002s elapsed)
   MUT     time  801.664s  (809.891s elapsed)
   GC      time   50.389s  ( 52.286s elapsed)
   EXIT    time    0.000s  (  0.009s elapsed)
   Total   time  852.053s  (862.189s elapsed)

   %GC     time       5.9%  (6.1% elapsed)

   Alloc rate    3,254,192,077 bytes per MUT second

   Productivity  94.1% of total user, 93.9% of total elapsed


 real    14m22.223s
 user    14m12.060s
 sys     0m7.559s
 }}}

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


More information about the ghc-tickets mailing list