| |
| Posted by Robert M. Münch in reply to Ben Hinkle | PermalinkReply |
|
Robert M. Münch
Posted in reply to Ben Hinkle
| On Sun, 29 Feb 2004 17:38:14 -0500, Ben Hinkle <bhinkle4@juno.com> wrote:
> Thinking more about GC performance, what do people
> think about adding some features to help it out?
Hi, I'm reaching the point in my Dernel kernel, where I want to get the GC stuff up and running. At the moment, the interface works but I use a stupid "just allocate" strategy with no-frees at all ;-). So we can play around with this.
> I'm thinking of "hints" that the programmer can
> put in D code to give the GC more information about
> what is going on. For example, assuming a generational
> GC will eventually be used in phobos, it would
> help out the GC to tell it if an object should
> immediately go into an old generation - many times
> I know when something will hang around for a while
> or if something is just going to be used for a few
> calls and then be gone.
I used to use memory-pools in C++. IMO if we can tell the GC, to setup pools for specific classes/structs and provide an estimated life-time, this could help selecting the best allocation strategy.
One other way would be to use templates for specialized GC implementations. In this case, you would instantiate exactly the best set of functions for your app. The GC would become spezialized for each app. I once came across a GC framework based on templates for C++. I need to have a look, if I still have this information.
> Also putting in a hook after gc_init to allow main()
> to set various GC parameters (before actually allocating
> anything) would be nice. For example Sun's Java GC
> implementation has command-line switches for customizing
> the GC behavior.
I like the template approach most. With run-time configuration you always have to carry around the complete code to handle everything. But the GC should become a highly specialized implementation fitting the current app.
> Or if people know about links to "user driven" GC that
> would be nice, too.
There is a GC project called "frankestein": http://www.cs.washington.edu/homes/pardy/research/gc/
I'm highly interested in this topic WRT Dernel. Understanding the GC code etc. is a necessary step, so any help is welcome :-))
--
Robert M. Münch
Management & IT Freelancer
http://www.robertmuench.de
|