[Haskell-cafe] Data.Array.Storable vs GC

David F. Place d at vidplace.com
Tue Nov 25 09:27:51 EST 2008

On Tue, 2008-11-25 at 16:51 +0300, Bulat Ziganshin wrote:
> Hello David,

Hello Bulat,

> Tuesday, November 25, 2008, 4:45:28 PM, you wrote:
> > However, I am getting very poor performance due to the GC copying 6G in
> > each run.  The only explanation that I can think of is that it is
> > copying my giant array.
> each GC run? each program run?

each program run

> try to increase size of your array and check how many data are now
> copied by GC (of course, everything else shouldn't be changed)

Excellent idea.   I made the array twice as big, Otherwise everything
else is the same. The GC copies the same amount of data.  The only
difference I noticed is that with the array twice as big, there were
about half as many collections in generation 1.  The time and efficiency
are about the same.  I guess it is not the fault of Data.Array.Storable.

When I was researching how to do this, I was really hoping for something
like "static areas" from the Lisp Machine operating system.  You could
allocate any normal object in an area of the heap where the GC would not
bother with it.  I miss that.  I wonder why GHC doesn't have such a

More information about the Haskell-Cafe mailing list