3 ms·
I keep seeing this latency claim about GC, but it would be trivial to solve with free if it were actually a problem: just add freed objects to a list and increm
by pcwalton 10y ago
I keep seeing this latency claim about GC, but it would be trivial to solve with free if it were actually a problem: just add freed objects to a list and incrementally free over time to achieve whatever latency guarantees you wish.
The reason why no malloc/free implementations that I'm aware of actually do this is that the latency of freeing isn't a problem in practice.
- naasking 10y ago> The reason why no malloc/free implementations that I'm aware of actually do this is that the latency of freeing isn't a problem in practice. Partly, and the other part is that it degrades allocation performance for the majority of non-problematic programs, which is what most people actually focus on. But if we're being fair, latency of tracing GC isn't a problem for most programs either. So latency is largely a red herring, except when it's not, and you had better know when it's not, regardless of whether you're using C/C++/Rust or a runtime with tracing GC.