A smaller GC benchmark

Sean Kelly sean at f4.ca
Mon Dec 10 13:12:38 PST 2007


Vladimir Panteleev wrote:
> On Mon, 10 Dec 2007 22:48:00 +0200, Robert Fraser <fraserofthenight at gmail.com> wrote:
> 
>> FWIW, I don't think non-moving GCs will ever be able to outperform a
>> well-tuned generational collector. But I'm not exactly in the know about
>> these things, so I may be wrong.
> 
> I'm not sure if generational collectors are moving GCs, but since you're comparing them to non-moving GCs I'll add that a moving GC needs full knowledge of type information to work properly. While confusing an integer for a pointer may be a forgiveable mistake for non-moving GCs, it's not for a moving GC. I think D isn't ready for that yet (especially considered that both Phobos and Tango maintainers/users insist on void[] being a type that's allowed to hold pointers).

The void[] thing is a language decision, not a runtime decision.  The 
runtimes for Phobos and Tango rely on TypeInfo.flags & 1 to determine 
whether a particular type contains pointers.  More exact type info for 
precise scanning would likely require a compiler change as well, since 
this would have to be added to TypeInfo.  All of this would allow for a 
moving GC, but the GC would still be somewhat conservative because type 
information would still not be available for the stack (unless the app 
contained debug information, perhaps).  So basically, any blocks pointed 
to from a location whose type is unknown, the block would effectively be 
pinned.


Sean



More information about the Digitalmars-d mailing list