4 ms·
Reference counting is also not free by itself (ignoring its cycle problems). There's overhead to all the incrementing and decrementing. It can add up in moder
by dpark 15y ago
Reference counting is also not free by itself (ignoring its cycle problems). There's overhead to all the incrementing and decrementing. It can add up in modern systems that toss around objects willy-nilly. Reference counting also adds a ton of additional synchronization points in a multi-threaded scenario.
- bunderbunder 15y agoYup. I don't think it's any coincidence that the only really prominent place where ARC is being used is iOS. It's a platform where reference counting was already in place, where you can have a reasonable hope that most the programs are too small and simple to take much of a hit on the overhead, and where memory leaks can't get too far out of hand because the OS reserves the right to kill processes whenever it wants.
- masklinn 15y ago> where you can have a reasonable hope that most the programs are too small and simple to take much of a hit on the overhead What overhead? There's no runtime overhead to ARC compared to manual reference counting.