SameerDalal / QuantumGo_Engine

GNU Affero General Public License v3.0
0 stars 1 forks source link

Optimize deduce_captures (60x speedup) #3

Closed benjaminpjones closed 2 months ago

benjaminpjones commented 2 months ago

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.