Re: Opinion on managed memory and garbage collection
Re: Opinion on managed memory and garbage collection
- Subject: Re: Opinion on managed memory and garbage collection
- From: Peter N Lewis <email@hidden>
- Date: Tue, 23 Jun 2009 11:37:06 +0800
On 22/06/2009, at 22:58 , Phil Hystad wrote:
If you were writing a new Cocoa application from scratch, would
garbage collection be the preferred method over the reference
counting (retain/release) method. Having spent years in Java I
would prefer a GC'd approach but I have also seen the great
improvement of GC in Java over the years. Therefore, I am also
curious on how the new Objective-C design for GC compares.
The applications I have in mind are mostly graphic (Quartz 2D)
oriented and likely also some OpenGL work.
The main issue is performance. GC is usually quoted as having a
10-20% performance hit, but obviously it would depend heavily on what
you were doing. If I was writing a new app from scratch that was not
likely to be CPU intensive, I would probably use GC. If I was writing
Keyboard Maestro from scratch, I would certainly use Garbage Collection.
That said, "graphic (Quartz 2D) oriented / OpenGL" might well fall in
to the CPU intensive sphere.
Also, if you are going to use GC, for heaves sake go and research the
dangling internal pointer issue (see the thread at <http://lists.apple.com/archives/objc-language/2009/Mar/msg00037.html
>) which scares the daylights out of me because its such a subtle bug
which would be horrendous to debug if you were not well versed with
the possibilities.
Enjoy,
Peter.
--
Clipboard Switching and Macros with Keyboard Maestro
Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/> <http://download.stairways.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden