• 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: Instance vars, local vars and speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instance vars, local vars and speed


  • Subject: Re: Instance vars, local vars and speed
  • From: "David Wilson" <email@hidden>
  • Date: Mon, 4 Aug 2008 10:12:43 -0400

On Mon, Aug 4, 2008 at 9:16 AM, Trygve Inda <email@hidden> wrote:

>> IMHO, this is just premature optimisation.
>>
>> That said, there is no cost to access an ivar using the 32 bits
>> runtime, and I don't think the cost on 64 bits runtime is important
>> enough to bother with it.
>>
>
> This is what I was trying to determine. Thanks.

It's not strictly true- the compiler can do more on a local variable
than it can on an ivar. That said, this is *definitely* premature
optimization; the difference won't be noticed except for extremely
tight loops, and it's simple enough to make local copies of an ivar
*after* Shark has shown that it's a problem.

I have gotten performance wins from that in a few isolated cases, however.

--
- David T. Wilson
email@hidden
_______________________________________________

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: 
 >Re: Instance vars, local vars and speed (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Instance vars, local vars and speed (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Instance vars, local vars and speed
  • Next by Date: Re: Restarting an app -- AppleScript 'launch' in a detached shell
  • Previous by thread: Re: Instance vars, local vars and speed
  • Next by thread: Re: Instance vars, local vars and speed
  • Index(es):
    • Date
    • Thread