Some simple ideas about GC

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Mon May 12 16:09:08 PDT 2014


I'd like to share some thoughts on improving D's GC, nothing radically 
different though.

A few observations

- Pause times seem to be a much bigger problem than CPU usage or memory 
bandwith. Focus on reducing the pause times.

- The GC code is already fairly optimized, so there is a very low 
profitability in small-scale code optimizations. Improve the algorithms 
not the code.

- The current GC code is not hackable. First rewrite then improve.

and corresponding ideas.

- Marking could be parallelized, sweeping should be done in the 
background, GC could serve allocations during sweep from a separate pool 
(e.g. thread-local).

- The current GC does a lot of bookkeeping work due to how the pools are 
organized (heterogeneous bin sizes). I suspect (but don't know) that 
there are big gains in organizing this differently.

- A testable and more modular rewrite (using recent D practices) would 
encourage more contribution and is necessary for experimentation.


-Martin


More information about the Digitalmars-d mailing list