4 ms·
I always thought it was the extra bookkeeping at runtime that was the drawback. Think of some tight loop that’s passing an object around. Your runtime has to in
by pkulak 4y ago
I always thought it was the extra bookkeeping at runtime that was the drawback. Think of some tight loop that’s passing an object around. Your runtime has to inc and dec an integer (or similar) on every touch. Plus, you’re adding to the size of every object. A generational GC may never even touch 90% of all objects, since they don’t make it out of the eden generation.
So you trade off some throughput for no pauses, which is why I imagine Apple prefers it.
EDIT: oh, and reference counting is a garbage collector, just a rather simple one.