[racket-dev] gc vs assignment

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Aug 24 19:38:30 EDT 2010

At Tue, 24 Aug 2010 16:03:00 -0700, Joe Marshall wrote:
> On Tue, Aug 24, 2010 at 3:43 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > At Tue, 24 Aug 2010 09:53:21 -0700, Joe Marshall wrote:
> >> I'm surprised that racket3m uses page protection.  Taking a hardware trap
> >> can often be thousands of times slower than taking an inline conditional
> >> branch.
> >
> > The hardware trap happens once per GC-managed page between minor
> > collections, while the inline condition happens every time an
> > assignment is performed.
> Right, but you have to have a marking granularity that is equal to the
> page size.
> Hosking and Moss discovered that card marking can be competitive with or
> faster than using the hardware.

Sorry --- I did not intend to claim that using the hardware is faster.
I only meant to clarify that we're not doing something that slows
programs by a factor of thousands.

> > I haven't been able to construct a program that mutates many pages a
> > small number of times between collections, thus maximizing the relative
> > cost of the trap versus a potential implementation with an inline
> > conditional; does enough work to trigger collections; and performs
> > little enough work relative to mutation so that the barrier cost is
> > measurable.
> Does Will Clinger have any data?

I don't know, and I'm afraid that I'm not knowledgeable enough to
easily translate any available data to the setting of Racket.

Do you have enough interest to help improve Racket's GC implementation?
It's an area where I've long thought that we've done adequately, but
not great. We could use someone knowledgeable to work through how to
get us from our current point to someplace better.

Posted on the dev mailing list.