[Haskell-cafe] Encouraging performance with ghc 7.4

Eugene Kirpichov ekirpichov at gmail.com
Wed Jan 18 17:22:47 CET 2012


Hi cafe,

Just wanted to inform you that I've been benchmarking my compute-intensive
stuff on ghc 7.0.4 vs 7.4.0, and 7.4.0 gave a large speedup - one program
that took 2.9s on a particular input is now taking 2.2s. This result is
repeatable.

So I encourage people to try out GHC 7.4.0. Some stuff may stop compiling
(I had to do 3 basically one-line fixes in 3 packages before I got mine to
compile), but I didn't encounter other problems.

Below is +RTS -s of two runs: one compiled with ghc 7.4.0 and another with
7.0.4.

I can make a more detailed comparison if it's useful and if someone tells
me how - I thought about including +RTS -p, but Simon Marlow wrote recently
that it has started giving meaningful results only in 7.4, so comparison
with 7.0.4 would be unfair.

However in this case I'm sure that the program is heavily compute-bound by
the following two functions (because it's always compute-bound by them):
1) https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Plots.hs#L226
2) https://github.com/jkff/timeplot/blob/master/Tools/TimePlot/Conf.hs -
localToUTC and strptime.

jkff at jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
cumsum 10' -o e.png +RTS -s
tplot -if e.trace -dk within[.] cumsum 10 -o e.png +RTS -s
   2,751,756,296 bytes allocated in the heap
     135,129,112 bytes copied during GC
      33,149,720 bytes maximum residency (22 sample(s))
       1,755,868 bytes maximum slop
              56 MB total memory in use (0 MB lost due to fragmentation)

  Generation 0:  4994 collections,     0 parallel,  0.22s,  0.23s elapsed
  Generation 1:    22 collections,     0 parallel,  0.08s,  0.09s elapsed

  INIT  time    0.01s  (  0.00s elapsed)
  MUT   time    2.61s  (  2.91s elapsed)
  GC    time    0.30s  (  0.32s elapsed)
  EXIT  time    0.00s  (  0.00s elapsed)
  Total time    2.91s  (  3.22s elapsed)

  %GC time      10.1%  (9.8% elapsed)

  Alloc rate    1,051,262,083 bytes per MUT second

  Productivity  89.6% of total user, 80.9% of total elapsed

jkff at jkff-laptop ~/projects/logs/... $ tplot -if e.trace -dk 'within[.]
cumsum 10' -o e.png +RTS -s
   2,161,811,620 bytes allocated in the heap
     107,589,660 bytes copied during GC
      34,799,400 bytes maximum residency (22 sample(s))
       1,721,152 bytes maximum slop
              58 MB total memory in use (0 MB lost due to fragmentation)

                                    Tot time (elapsed)  Avg pause  Max pause
  Gen  0      3899 colls,     0 par    0.13s    0.14s     0.0000s    0.0003s
  Gen  1        22 colls,     0 par    0.08s    0.09s     0.0043s    0.0482s

  INIT    time    0.00s  (  0.00s elapsed)
  MUT     time    2.03s  (  2.28s elapsed)
  GC      time    0.21s  (  0.23s elapsed)
  EXIT    time    0.00s  (  0.00s elapsed)
  Total   time    2.26s  (  2.51s elapsed)

  %GC     time       9.3%  (9.1% elapsed)

  Alloc rate    1,056,397,390 bytes per MUT second

  Productivity  90.7% of total user, 81.5% of total elapsed


-- 
Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120118/d8a7caf7/attachment.htm>


More information about the Haskell-Cafe mailing list