Author: Andrew Dados
Date: 11:53:11 12/05/01
Go up one level in this thread
On December 05, 2001 at 05:33:08, Uri Blass wrote:
>In my program I have the following commands when I generate my pin arrays:
>
>if (color(sq)==side)
>{
> pin[sq]=-1;
> d=direction[kingsquare[color(sq)]][sq];
>...
>
>The strange speed demage to my program happens when I try to replace color(sq)
>with side in the last line
>
>color(sq) is more complicated to find then finding side that is simply integer.
[snip]
Many responders pointed out that adding some lines to code may create a speedup
(also deleting some tiny line may create slowdown).
While data size you work with is important, effect you are observing is
attributed mostly to code alignment/misaligment in 32 bit boundaries (also in
8*32bit, as that is the size of chunk fetched into cashe).
Changing size of generated instruction(s) may result in (mis)aligning large
chunk of following code. I am not sure if msvc++ tries to align instructions by
generating noops and where (maybe to align function start...). Anyway effect is
noticeable, but not controllable.
I once decided not to pay too much attention to that and try to write as simply
as possible.
-Andrew-
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.