This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Pliant and ref counting


Telford Tendys <telford@eng.uts.edu.au> writes:
> 
> I am coming to the conclusion that garbage collection won't work for
> large databases. At least, you can't garbage collect them often because
> there is so much data in the system that collection time slows everything
> down. I feel that maybe within the database I sould be reference counting
> and then copy the data out to a garbage collection environment on the
> outside of the database. I would prefer to avoid needless copying but
> copying is fast compared to scanning the whole database.

For some specific cases (like a large database), where it's worth the
effort for performance, it is better to roll your own, since a general
garbage collector won't be the absolute best for everything. I'll
guess that, for the most part, a database tends to grow or stay the
same size, so the objects won't have the expected lifetime tendencies
that objects in a general scheme code would, so the gc is trudging
through a large chunk of memory, assuming blatently wrong things. 

> The argument of ref counting against garbage collection is still largely
> unsolved, and depends on the application.

I'm going to be pedantic, and point out that ref counting is a form of
garbage collection ;) Ref counting can work quite well when you have a
large set of `simple' data (most importantly, no circular references),
which I guess describes a database pretty well.
 
-- 
Greg