• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Constructive Criticism
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Constructive Criticism (From: Mick Walker <email@hidden>)
 >Re: Constructive Criticism (From: Alastair Houghton <email@hidden>)
 >Re: Constructive Criticism (From: Derek Chesterfield <email@hidden>)

  • Prev by Date: Re: NSAlert - multiple key equivalents for buttons?
  • Next by Date: Re: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
  • Previous by thread: Re: Constructive Criticism
  • Next by thread: Re: Constructive Criticism
  • Index(es):
    • Date
    • Thread