GC performance - was Re: [gclist] GC topics
Tyson Richard DOWD
trd@mundil.cs.mu.OZ.AU
Thu, 22 Feb 1996 12:01:54 +1100 (EDT)
>
> >
> > Darius Blasband, you wrote:
> > >
> > > In any case, I think we agree on the fact that precise GC is far easier,
> > > and globally more reliable and faster than conservative GC's...
> >
> > I definitely disagree about precise GC being easier.
> >
> Let's say that it is surely easier to implement (from scratch), since
> it requires almost no knowlegde about the internals of the machine,
> memory mapping of the compiler, etc...
>
>
> > Plugging in Hans Boehm's conservative garbage collector to our
> > Mercury implementation was very easy. It took a couple of days at most.
> Well, I guess that plugging in a GC is indeed easier than writing
> one's own, but is this the issue ?
>
> >
> > Writing our own precise GC has so far consumed the work of one honours
> > thesis and two summer studentships (i.e. about 6 man-months of work),
> > and it still isn't complete.
> >
> I simply do not understand: it does not match my experience at all, and from
> what I know of Mercury (purely logic typed language, generates intermediate
> C, am I right ?) there is nothing which should explain why it is so
> difficult. Maybe the simple fact that it is being implemented on an existing
> system, instead of being part of the original design. I don't know. My
> experience about implementing a precise GC tells exactly the opposite.
> Any clue on the reason for this ? Anything too specific about Mercury ?
>
I believe you have been referring to a precise GC scheme that does some
sort of runtime analysis/book-keeping to obtain precise information about
the types of data (hence your 20% execution time slowdown).
The Mercury precise GC system has almost no forward execution cost, all
analysis is done statically, both at compile-time, and at link time.
This probably makes some impact on the time taken to develop it.
The GC system wasn't really part of the original design -- in that no real
efficiency concessions were made to support GC in other parts of the
compiler -- this probably also made precise GC more difficult to implement.
--
Tyson Dowd # Another great idea from the
# people who brought you
trd@mundil.cs.mu.oz.au # Beer Milkshakes!
http://www.cs.mu.oz.au/~trd # Confidence --- Red Dwarf