Accessing new heap costs more than old?

Adrian Hey ahey at iee.org
Mon Sep 12 17:21:02 EDT 2005


Hello Simon,

Thanks for your suggestion (I didn't know about this option)

On Monday 12 Sep 2005 12:04 pm, Simon Marlow wrote:
> On 05 September 2005 19:38, Adrian Hey wrote:
> > On Monday 05 Sep 2005 5:42 pm, Jan-Willem Maessen wrote:
> >> This agrees with my theory.
> >
> > Thanks, I'm sure this must be the explanation. I guess the moral of
> > the story is that for comparative benchmarks you really do need to
> > make sure you're comparing like with like. Very small differences in
> > test method can have a significant impact on running time it seems.
>
> Can you confirm the hypotheses by inspecting the output from +RTS
> -sstderr, which tells you the breakdown of GC vs. mutator time?

OK, I've done the tests and they do seem to confirm this, but
they're a bit misleading because the figures presumably include time
and energy spent calculating the test data too, which is non-trival.
(the Insertion times reported do not include test data calculation).

--------------- Non-cumulative -------------
InsertTime = 280.0
1,061,418,244 bytes allocated in the heap
342,983,048 bytes copied during GC
 24,097,548 bytes maximum residency (16 sample(s))

       3652 collections in generation 0 (  3.90s)
         16 collections in generation 1 (  2.98s)

         62 Mb total memory in use

  INIT  time    0.00s  (  0.00s elapsed)
  MUT   time   10.73s  ( 10.74s elapsed)
  GC    time    6.88s  (  7.01s elapsed)
  EXIT  time    0.00s  (  0.00s elapsed)
  Total time   17.61s  ( 17.75s elapsed)

  %GC time      39.1%  (39.5% elapsed)

  Alloc rate    98,920,619 bytes per MUT second

  Productivity  60.9% of total user, 60.5% of total elapsed

--------------- Cumulative -------------
InsertTime = 775.0
1,068,399,252 bytes allocated in the heap
546,486,356 bytes copied during GC
 23,234,404 bytes maximum residency (20 sample(s))

       3679 collections in generation 0 (  6.89s)
         20 collections in generation 1 (  4.33s)

         61 Mb total memory in use

  INIT  time    0.00s  (  0.00s elapsed)
  MUT   time   11.89s  ( 11.93s elapsed)
  GC    time   11.22s  ( 11.34s elapsed)
  EXIT  time    0.00s  (  0.00s elapsed)
  Total time   23.11s  ( 23.27s elapsed)

  %GC time      48.6%  (48.7% elapsed)

  Alloc rate    89,856,959 bytes per MUT second

  Productivity  51.4% of total user, 51.1% of total elapsed

Regards
--
Adrian Hey



More information about the Glasgow-haskell-users mailing list