3 ms·
> Garbage collection usually works out to a performance / latency tradeoff. (A GC app runs faster than a non-GC app, but has latency.) If I get to the point whe
by klodolph 9y ago
> Garbage collection usually works out to a performance / latency tradeoff. (A GC app runs faster than a non-GC app, but has latency.) If I get to the point where latency, even with a pause-free of concurrent GC is a problem, then I know I chose the wrong language.
I think you mean "throughput / latency"? Latency itself is a measure of performance.
It's a fair bit more complicated than that once you start tuning the GC, because the GC can be tuned towards either throughput or latency, and it can be tuned aggressively towards either end. For example, for a given program you can tune the GC so you get fantastic throughput for batch programs. Use a copying GC, and set the heap size large enough that the percentage of live pages is very low when you collect. On the other hand, you can use something like the tri-color collector, which runs in parallel with the main thread and kills throughput, but has minimal impact on latency (sub-millisecond pauses).