Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: (no subject)



> > I wanted to mention it and then forgot, but yes, those variables are  
> > of external scope, as they are instance variables of an objc object.  
> > They are thus members of a struct, which is passed by ref to the  
> > function (as objc objects are pointers to struct). So yes, this is  
> > probably the problem. I never thought of it in this particular  
> > configuration... Is the fix to use a local variable instead? Something  

Yes. The compiler is reloading your pointers on every loop iteration because
it can't tell whether your stores alias to those pointers (which means the
ptr value could change from one iteration to the next).

Shark says:

"Common causes of invariant loads within a loop are a pointer dereference
within the loop or use of a global variable. You can eliminate this
inefficiency by using a temporary local variable within the loop."

You should consider unrolling the loop too.

--Sanjay


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.