Author: Matt Taylor
Date: 01:15:25 01/02/03
Go up one level in this thread
On January 02, 2003 at 02:32:05, Lieven Clarisse wrote:
>On January 01, 2003 at 19:36:56, Dieter Buerssner wrote:
>
>>On January 01, 2003 at 11:50:58, Lieven Clarisse wrote:
>>
>>>I know for instance that:
>>>
>>>ptr=&R[i];
>>>if((*ptr==3)||(*ptr==7)) {;}
>>>
>>>is faster then:
>>>
>>>if((R[i]==3)||(R[i]==7)) {;}
>>
>>How did you test it? I checked compiler generated assembly in similar cases.
>>Typically, they are the same, using pointers or arrays. Sometimes arrays will be
>>faster.
>>
><SNIP>
>>Regards,
>>Dieter
>
>I didn't test it, I read it in some dubious book. That is why I would like to
>have a *good* book about optimization. The examples were only meant as examples,
>here another one:
>
>In the same book I read this:
>
>#pragma intrinsic strcmp
>
>would make your program faster when using strcmp, but they don't motivate why.
>
>--> So anyone knows a GOOD book were I can find all such things in?
>
>best regards,
>
>lieven
Intrinsic means "inline" as in it eliminates the function call. It is faster to
a degree, and it will make your code size bigger. The rule of thumb is something
or other like 40 instructions or smaller should be inline. Any function that is
called from one place or is very small is a good candidate to be inlined.
-Matt
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.