3 ms·
I find the automatic garbage collection particularly impressive, but I wonder how it affects performance: Apple could have included the ability to use Objective
by spicyj 17y ago
I find the automatic garbage collection particularly impressive, but I wonder how it affects performance: Apple could have included the ability to use Objective-C 2.0's GC on the iPhone, but they didn't.
- alttab 17y agoThat may have been a good thing. In some cases, stacking two layers with conflicting policies could thrash from caching/garbage collection logic. This is at least the argument of most full stack proprietary formats.
- tumult 17y agoActually, it's often not performance that's the problem like you might be thinking. Some apps, for example, actually become faster with Obj-C 2.0 GC enabled, since all of the retain/release message sends become noops. (Some will be slower, too, of course.) What you do definitely lose is easy predictability of memory usage. Memory usage can spike when you don't anticipate it. On a desktop this is no problem, since you have a ton of memory to work with, and if you do use too much, it just swaps to disk. On iPhone, if you exhaust the memory, the phone reboots. Oops. But I don't think GC is too far off for iPhone.