gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] yet another speedup in board.c


From: Arend Bayer
Subject: Re: [gnugo-devel] yet another speedup in board.c
Date: Sun, 23 Mar 2003 13:50:04 +0100 (CET)

On Thu, 20 Mar 2003 address@hidden wrote:

> - speed optimization in do_play_move()
> - bugfix do_commit_suicide()
>
> it's a long time since the last speed optimization patch ;) the idea
> of this one was to use the fact that do_play_move() is mainly called
> from do_trymove(), which handles suicidal moves itself (claims they
> are illegal). so i rewrote do_play_move() and it now plays only non-
> suicidal moves (play_move_no_history() plays suicides through
> do_commit_suicide()).

> to a total speedup of around 1.5%. i haven't rerun the regressions, but
> there
> must not be any changes (works as should on reading.tst and nngs.tst).

Nice.

However, I would suggest to leave out this change:
> @@ -3856,8 +3860,9 @@ remove_liberty(int str_number, int pos)
>   */
>
>  static int
> -do_remove_string(int s)
> +do_remove_string(int str)
>  {
> +  int s = string_number[str];
>    int pos;
>    int k;
>

The convention in board.c seems to be that all static function reference
strings by their string number (instead of their position) where
possible. I suppose it's better to try to be consistent to avoid
confusion.

Arend







reply via email to

[Prev in Thread] Current Thread [Next in Thread]