[computer-go] Fast Board implementation

Łukasz Lew lukasz.lew at gmail.com
Fri Dec 15 08:25:09 PST 2006


if (is_player (color_at[v]))
  chain_at[v].find_root ()->inc_lib_cnt ();

I removed the if

chain_at[v].find_root ()->inc_lib_cnt ();

And added some code elsewhere to make it correct.

this code is executed for every neighbour intersection (v) of
intersection that just turned into empty (was captured)

Removing the "if" was more than 4% speedup.

Lukasz

On 12/15/06, steve uurtamo <apoxonpoo at yahoo.com> wrote:
> > I confirm branches are most costly.
> > Removing 1 not needed "if" gave me speedup of 5%.
>
> do you mean that the 'if' was never evaluated,
> or that it always evaluated the same way, or
> that it was handled elsewhere?  i'm stunned
> that a single 'if' was 5% of the execution time
> of your code.  it might make more sense if your code
> was 20 'if' evaluations, all of which had empty
> bodies.
>
> s.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> computer-go mailing list
> computer-go at computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/
>


More information about the computer-go mailing list