Since Board.status only needs to check if there are legal moves or not, it is slow and pointless to calculate all legal moves, especially since this would often be in hot code areas (search/eval functions).
Perf says Board.status takes around a third of my engine's running time, so this is an issue.
Edit: Board.status takes around 20% of my engine's running time with this change.
Since Board.status only needs to check if there are legal moves or not, it is slow and pointless to calculate all legal moves, especially since this would often be in hot code areas (search/eval functions).
Perf says Board.status takes around a third of my engine's running time, so this is an issue.
Edit: Board.status takes around 20% of my engine's running time with this change.