[racket-dev] gc vs assignment

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Aug 24 18:43:43 EDT 2010

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.

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

Posted on the dev mailing list.