[jhc] good news everyone
john at repetae.net
Thu Apr 8 14:30:24 EDT 2010
I have finally gotten around to what I have been promising to do for
years and implemented a garbage collector for jhc. It is still fairly
rough, but is very promising. In truth, I was worried it might kill
jhc's performance advantage, but quite the opposite, it actually
improves the performance of several benchmarks, and doesn't cut too deep
into jhc's speed advantage in others.
In particular, it seems to help ones where jhc did particularly worse
than ghc, I had always assumed those cases were due to some pathological
case in an inner loop that ghc was able to catch but jhc wasn't, but it
turns out the presence of the GC played some role in their speed. I am
not sure whether it is the short circuiting redirects or memory locality
that is helping.
In any case, JGC seems to be a couple times faster than the boehm
collector so all in all, it is a good option to have. Right now, using
jgc means you have to link against the judy library, this restriction
may or may not be lifted in the future. libJudy is an amazingly useful
and versatile library, keeping the GC information stored independently
of the heap allows me to garbage collect without trouncing all over the
memory space and I think this is key to getting acceptable performance
from the GC.
I am actually quite pleased with the results, the implementation is a
very naive mark-and-don't-quite-sweep collector and achieves good
performance, in particular, it isn't even generational. So there is
still a fair amount of room for speed improvement.
The GC is still experimental, it still doesn't support some features
like IORefs and the method for collecting gc roots is fairly brute force
and sloppy, but the essential work is done.
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the jhc