[Pachi] Low-hanging fruit - hacking ideas

Matthew Woodcraft matthew at woodcraft.me.uk
Sat Jun 4 14:40:00 CEST 2011

Petr Baudis wrote:
> Oh, I'm sorry. I meant board_is_valid_play(), at least that seems to be
> the cause of the
> 	    12.83%        pachi  ./pachi                    [.] apply_pattern
> profile entry - the core goal is to fix this since apply_pattern()
> really should be much faster than that I believe.

For what it's worth, I've done a bit of profiling in an optimised build.

I see apply_pattern() at about 14%, which is very close to your figure,
but I get roughly the following breakdown inside it:

   30% -- pattern3_move_here
   20% -- board_is_valid_play
   15% -- 'second move for pattern searching' overhead (coord_is_8adjecent &c)
   10% -- hash3_to_hash
   25% -- other

So it looks like the board_is_valid_play() calls aren't the main


More information about the Pachi mailing list