deduce_captures is a hot path in the simulation code. An optimization we can add is to only check the adjacent groups. This means we check only 4 groups instead of 361 which constitutes a roughly 60x speedup.
The reason this optimization is valid is that liberties can only be removed where a stone is played.
deduce_captures
is a hot path in the simulation code. An optimization we can add is to only check the adjacent groups. This means we check only 4 groups instead of 361 which constitutes a roughly 60x speedup.The reason this optimization is valid is that liberties can only be removed where a stone is played.