Proposal: Pooled memory management

Fergus Henderson fjh at
Mon Jan 20 11:41:08 EST 2003

On 20-Jan-2003, Simon Marlow <simonmar at> wrote:
> So, assuming the performance is roughly the same (I'm guessing that
> using pools may be slightly faster than mallocForeignPtr, but not
> significantly)

I am not yet convinced that this is a reasonable assumption if you
are considering a wide range of Haskell implementations.  Some Haskell
implementations might use conservative collectors, and others (e.g. for
.NET or JVM) may use collectors which are tuned for imperative/OO
applications.  On such implementations there might well be significant
performance advantages to using pool-based manual memory management
rather than garbage collection.  In particular I suspect that pool-based
manual memory management operations can be O(1) in some situations when
non-copying GC'd allocation would be O(live data).

I have observed significant overall speed-ups (e.g. for the Pseudoknot
benchmark, about a factor of two) from using pool-like memory management
rather than the Boehm collector.

Fergus Henderson <fjh at>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

More information about the FFI mailing list