سؤال

I'm developing an iPhone OpenGL app. My question is: will using ivar instead of properties significantly improve performance?

I know there're many discussions around ivar vs properties; but my question is specific to OpenGL ES. Using property getter will take some CPU time, this is typically ignorable. How about in OpenGL ES?

هل كانت مفيدة؟

المحلول

Like sergio, I don't think properties will have enough overhead to effect performance.

My bit of advice is don't try to predict performance bottlenecks. Code the best system you can, then take time after you have enough of the project done for a system test to do performance optimizations. Use performance testing tools to find where the actual bottlenecks are.

Premature optimization is the root of all evil – Knuth

نصائح أخرى

I'm developing an iPhone OpenGL app. My question is: will using ivar instead of properties significantly improve performance?

IMO, not at all. in OpenGL ES accessing a variable is just the same as when using other frameworks: negligible. Furthermore, in OpenGL, performance limitation comes from the management of the pipeline and reading some state variable, e.g., so you can safely use properties.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top