Manuel M. T. Chakravarty chak at cse.unsw.edu.au
Mon Dec 4 19:00:37 EST 2000

Simon Marlow <simonmar at microsoft.com> wrote,

> > > because I recon eliminating the exception handler is more 
> > important than
> > > speeding up the actual malloc/free.
> > 
> > Hmm...
> alright, here's some quick benchmarks using 4.08.1:
> 1e6 * "bracket"              = 0.20 secs
> 1e6 * "bracket+malloc/free"  = 0.69 secs
> 1e6 * "malloc/free"          = 0.40 secs
> 1e6 * "allocate ByteArray"   = 0.13 secs
> Ok, so the malloc/free is the most expensive part.  I'm moderately
> surprised :)  Perhaps we could do a better job, but we'll never do
> better than ByteArrays as long as the bracket is required.

You also mentioned in an earlier message that you see scope
for improving on the exception handling.  If that is the
case, I would aim for getting rid of malloc/free and leave
the exception handler in.  This way, we have some benfit now
and more when exception handling is speeded up.

I am inclined to go this route also, because the exception
handling is under our control, but alloc/free isn't.


More information about the FFI mailing list