3 ms·
For software applications at least there's not much of a difference between ref-counting and garbage collection, both are equally bad when memory is allocated a
by flohofwoe 6y ago
For software applications at least there's not much of a difference between ref-counting and garbage collection, both are equally bad when memory is allocated and freed with a high frequency. A well written and tweakable GC will most likely perform better than refcounting in such situations.
The best way to improve memory management performance is to allocate and free much less frequently, not to write a better garbage collector, faster allocator or smarter shared-pointer and this is also why manual memory management is the right answer to garbage collection when performance matters, and not refcounting (again: only when memory management performance actually matters).
I'm not sure how much this also applies to virtual memory management though.