Deforestration harmful?

Simon Marlow simonmar@microsoft.com
Mon, 6 May 2002 12:02:33 +0100


> An obvious thing to try was to increase the heap size.
> Again we were surprised. Indeed the GC time decreased
> but the running time in the profile (excluding the GC time)
> increased a bit. Our guess was that it might have something
> to do with the way GHC allocates new memory cells such that
> larger heap results in longer allocation time. It was quite
> tricky to find the best heap size at which the program
> runs at maximal speed.
>=20
> Are the above guesses are plausible? Is it a known phenomena?

It is entirely plausible that as you increase the heap size the mutator
time increases: this is because you get fewer cache hits with a larger
heap.  GHC starts off with a small heap size so as to try to make the
most of the cache.  However, on most examples we've seen the benefits of
reducing garbage collections by increasing the heap size tend to
outweigh the benefits from staying in the cache.

Did you try heap profiling to discover what structure was filling up the
heap?

Cheers,
	Simon