Instance vars, local vars and speed
Instance vars, local vars and speed
- Subject: Instance vars, local vars and speed
- From: Trygve Inda <email@hidden>
- Date: Mon, 04 Aug 2008 11:26:11 +0000
- Thread-topic: Instance vars, local vars and speed
I am transitioning some code from Carbon to Cocoa and redesigning a lot of
how things work. I am doing a bit of low-level pixel manipulation and
wondering about speed of access to variables declared in a method vs those
declared at the object level.
Obviously things like x,y loop counters are local to a method, but some
things need to be shared between methods and rather then passing values
around, it would be cleaner to declare these at the object level.
How much of a hit am I going to take?
Would it be best to declare them at the object level and copy it into a
local as needed... Will the compiler be smart enough to sort this out?
Will it ever put object (instance) variables in a register?
I know it may require real world testing, but it affects my overall design
too. Note that it could be going through a loop roughly 3 million times on a
large image.
Many thanks,
Trygve
_______________________________________________
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