4 ms·
It's generally true to be fair, reference counting could be used for every garbage collected language (and be much simpler). The only reason they switched to mo
by scratcheee 4y ago
It's generally true to be fair, reference counting could be used for every garbage collected language (and be much simpler). The only reason they switched to more complex schemes is they're faster on average. Even smart schemes that try to remove unnecessary ref count changes will tend to underperform compared to a (well built) tracing GC. As for a reference, https://en.wikipedia.org/wiki/Tracing_garbage_collection#Performance https://en.wikipedia.org/wiki/Tracing_garbage_collection#Per...
The point about predictability is totally valid though (and combined with simplicity is the reason many languages still pick ref counting).
- marcosdumay 4y agoIt's not generally true. It's true for the case when the runtime keeps track of every little memory segment.