Subj : Re: OO compilers and efficiency To : comp.programming From : Scott Moore Date : Mon Jul 25 2005 01:56 pm Jon Harrop wrote: > Rob Thorpe wrote: > >>I think large applications are where GC is more useful. Programs that >>have large amounts of code tied to them generally fall into two >>categories, either 1) a few small parts of the code determines the >>run-time or 2) large parts of the program determines the run-time. >>In case #1 GC can be used to save programming time. In the critical >>parts GC need not be used if it's slow. > > > Modern languages often force GC upon you. Consequently, you cannot just "not > use it". However, you can often learn how to write GC-friendly code > instead. > Anybody who writes critical code that uses simple techniques to insure that they get what is wanted from the allocator, regardless of type (automatic or regular GC). For example, if you need to rapidly aquire entries, you get them in bunches and queue them up for future allocations. Another example is that you release them to a private list instead of disposing of them, so that you can get them rapidly from a small pool of reserved entries. In addition, there are garbage collectors, and there are garbage collectors. The stupid ones wait until they run out of continigous space before running a collection cycle, garanteeing that the system will go offline for a significant period of time. The smart ones do a good job of reclaiming space while doing allocations, moving a block or so in order to satisfy a given request, and continuously run cleanups during background times when there is nothing going on. .