Re: Instance vars, local vars and speed
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