Re: are static operations optimized?
Re: are static operations optimized?
- Subject: Re: are static operations optimized?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 27 Jan 2009 17:43:59 +0100
Le 27 janv. 09 à 17:32, David Harper a écrit :
Hello,
Though perhaps it is irrelevant to fuss about O(1) operations, I was
wondering if anyone with some familiarity with the objective-C
compiler could say whether static operations are actually calculated
at runtime or parsed & pre-calculated for optimization purposes.
When I say static operations I refer to those without variables.
For example, if I had a method with the following return statement:
return (128 - 6);
would this be compiled as "return 122" ? Would pre-calculating such
things save a relevant amount of clock cycles if such a statement
were evaluated, say, 100,000 times per second?
Just curious. I apologize if this is the incorrect list for such a
question.
Yes, this kind of expression is an "integer constant expression" and
must (or should, I don't remember) be evaluated at compile time
according to the C standard.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden