[jhc] the new GC, anyone got a bitset?

John Meacham john at repetae.net
Fri Jun 4 03:57:41 EDT 2010

So I am exceedingly pleased with what has been happening with the new GC
in jhc, enough that I am going to push for a major release in not long.
With some careful profiling and tweaking I have been able to ensure
enabling GC is a fairly dramatic win in terms of performance and memory
for the majority of haskell programs.

There is just one thing that is bothering me, I still rely on libJudy in
the runtime for its extremely fast bitset operation. Basically, in order
to determine if an address is allocated on the heap vs on the stack or
in the bss or data segments, I use a bitmap, adding an entry for each 4M
chunk of memory dedicated to heap pages. on a 64 bit system, using a
plain bit array is just not feasable, libJudy has a very fast bitset
that I utilize, but it is not exactly lightweight and is LGPL which may
cause issues for creating statically linked executables from jhc.

So, I am looking for a very fast (in querying, updates need not be that
fast) bitset that maps a 'uintptr_t' to either true or false, chances
are it will be very sparse. I'd like something I can embed in the
runtime, so it should not be very big. jhc executables are on the order
of 8k maybe compiled, so adding 4k of bitmap code for just this isn't
really ideal.

So, anyone have something in the public domain sitting around?


John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/

More information about the jhc mailing list