Re: Constructive Criticism
Re: Constructive Criticism
- Subject: Re: Constructive Criticism
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 07 Oct 2009 11:24:35 -0700
On Oct 7, 2009, at 9:53 AM, Derek Chesterfield wrote:
Just an aside, but does either syntax got optimised by the compiler
(GCC or LLVM). Obviously it can't in all cases, but this seems an
obvious case where it could be replaced by an assignment.
Message sends can never be optimized away by the compiler because a
message send can always change behavior at runtime.
Given that foo.bar is synonymous with [foo bar], neither will ever be
optimized by the compiler.
With Snow Leopard, the runtime does have a vtable based dispatch
optimization. The 16 most common selectors, which compose
approximately 70% to 85% of all method calls in a typical application,
use the vtable optimization. The set of selectors is slightly
different between GC and non-GC applications (because there is no
point in optimizing retain/release/autorelease in the GC case; they
are short circuited much earlier than actual dispatch).
Note that the vtable based dispatch is entirely transparent to your
code. The only time you'll see it is if you try to invoke one of the
optimized methods on a garbage object reference and cause objc_msgSend
() to crash.
b.bum
_______________________________________________
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