Re: Why ARC over garbage collection?
Re: Why ARC over garbage collection?
- Subject: Re: Why ARC over garbage collection?
- From: Jens Alfke <email@hidden>
- Date: Mon, 15 Oct 2012 17:24:41 -0700
On Oct 15, 2012, at 4:02 PM, Fritz Anderson < email@hidden> wrote: Garbage collection requires a continuously-running thread.
No, it doesn’t. The collector only needs to run if objects are being allocated by the app threads. Otherwise it blocks. None of this is acceptable on devices that have limited battery life, comparatively little RAM, no paging, and CPUs that are orders of magnitude slower than those in desktop machines. Unless they’re Android or Windows Phone devices, both of which use garbage-collected runtimes (Java and C#/CLR, respectively.)
Also, the CPUs may be slower than current desktops/laptops, but they’re no slouches. The iPhone 5’s CPU is apparently as fast as the fastest PPC G5s Apple ever released. And garbage collection was being used effectively on older computers many orders of magnitude slower than that.
As I said before, it’s much harder (perhaps impossible) to implement really efficient GC for native apps. It works a lot better in ‘managed’ environments like Java/C#/Smalltalk/LISP/etc.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden