.Net does have a pretty damn good GC. It is both a moving garbage
collector (improves locality, reduces heap fragmentation and
allows for memory allocation to be a single pointer operation)
and a generational garbage collector (reduces garbage collection
cost by leveraging heuristic that most collected objects are
usually very young). I believe their server GC is even concurrent
to avoid long stop the world pauses.

The problem is I'm not sure how much of those principles can be
applied to D. I can see moving objects being problematic given
that D supports unions. Another thing to consider is that .Net's
GC is the results of many man years of full time work on a single
platform, while D is mostly done by volunteers in their spare
time for many platforms. It would probably require a lot of work
to port, unless you're volunteering yourself for that work;)

On a related note, I've wondered for a long time why D's GC isn't
generational and why there's all this discussion on making it
concurrent and none on making it generational. It seems to me
that making it generational is simpler than making it concurrent
and provides a net win in overall performance while concurrent
only provides a win for real time systems that can't afford long
GC cycles.

Reply via email to