3 ms·
> And I was wondering how can a tracing GC outperform a non-tracing GC memory manager. The cliché is that malloc/free style memory management has to touch all
by throwaway81523 4y ago
> And I was wondering how can a tracing GC outperform a non-tracing GC memory manager.
The cliché is that malloc/free style memory management has to touch all the garbage in order to free it, while a semispace GC only has to copy the live data once in a while. The garbage is ignored.
- masklinn 4y agoAfaik Go uses a non-moving GC, so it can’t be a semi space.
- pkolaczk 4y agoHowever, when a tracing GC runs, it has to touch massive amounts of cold data and pushes hot data out of cache. Traditional malloc/free touches data in small chunks and freeing happens close to the last use, so when most of the data is still hot in cache. Stable, predictable performance is often more important than the peak performance.