[Gc] Slightly off topic: Are there any benchmarks comparing the speed of gc v non gc?

Boehm, Hans hans.boehm at hp.com
Thu Jan 17 10:57:34 PST 2008

I also recommend reading that paper.  And I agree with Bruce's answer.

But it's worth keeping in mind that this is affected a lot by all of:

1) Application characteristics.  Small objects tend to favor GC; large objects tend to be less expensive with explicit management.  In an explicitly managed environment, allocation/deallocation costs are largely independent of object size (though initialization cost of course is not).  In a garbage collected environment, your share of GC cost tends to increase with allocation size, but the constants are often such that GC wins at the very low end, certainly with sufficiently large heaps.

2) Implementation characteristics.  Tracing rates of collectors vary greatly, as does malloc/free performance.

3) Threading characteristics.  At the moment, most garbage collectors generally incur much less additional overhead to support threads than do most malloc/free implementations.  The standard Linux malloc often slows down dramatically if you run an empty thread at the beginning so that malloc starts acquiring locks.  Emery argues that this should be orthogonal to GC vs. explicit allocation.  And I think he's mostly, though perhaps not entirely, right.  (His malloc implementation is one of the few that I think does get this right.)

There are some gcbench results (warning: toy benchmark) in my ISMM tutorial slides from a few years ago.  (http://www.hpl.hp.com/personal/Hans_Boehm/ismm/04tutorial.pdf, starting around page 52).  This compares mostly our collector with thread-local allocation against Linux malloc (which locks on allocation and deallocation) on a benchmark that allocates very small objects, though it also looks at the large object case.  It looks more favorable to GC than Emery's results, but it's making different assumptions (and using a much less convincing, though easier to analyze, benchmark).


> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Aleksey Demakov
> Sent: Thursday, January 17, 2008 3:37 AM
> To: Sean Cross
> Cc: gc at napali.hpl.hp.com
> Subject: Re: [Gc] Slightly off topic: Are there any
> benchmarks comparing the speed of gc v non gc?
> Hi Sean,
> On Jan 17, 2008 4:41 PM, Sean Cross <sean at picsprint.com> wrote:
> > Are there any publicly available benchmarks that would
> demonstrate the
> > truth or otherwise of this?
> >
> http://www.cs.umass.edu/~emery/pubs/gcvsmalloc.pdf
> Regards,
> Aleksey
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/

More information about the Gc mailing list