jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
245 stars 57 forks source link

Board.status unnecessarily calculates all legal moves #63

Open AlexanderHarrison opened 3 years ago

AlexanderHarrison commented 3 years ago

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.