RTS/Garbage Collector idea

Simon Marlow simonmarhaskell at gmail.com
Mon Jun 18 09:00:02 EDT 2007


Isaac Dupree wrote:

> I was thinking, since we have a copying garbage collector that reassigns
> all pointers anyway, could we detect the "identical" heap objects and
> for each set of identical ones, have all thunks that pointed to any of
> them, now point to the single one that is created in the target space?

I think what you're proposing is often called "hash consing", except that 
hash-consing is usually done at construction time, you want to do it at GC time.

My take is it would only be worthwhile if there was a *lot* of sharing to be 
gained by doing it, and in most cases there wouldn't be.  This is just a guess 
based on my experience poking around in the heap though - feel free to try it 
out and prove me wrong :-)

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list