Closed jordanbray closed 5 years ago
Current results of cargo bench
, which compares the performance of movegen
and board
methods of enumerate moves.
MoveGen is now replacing enumerate_moves. enumerate_moves still exists, but has been marked as deprecated, and simply uses the MoveGen structure internally.
MoveGen is now faster in almost all test cases.
At present, there are two ways to generate legal moves. The first is to use board.enumerate_moves(...), which is the fastest, but requires you to pass in an empty array of 256 ChessMove's to mutate, and also does not give you an iterator or anything nice to work with. The second way is to use the MoveGen object, which has a lot of nice features, but is slightly slower for raw perft tests (it's actually probably faster in a chess engine, though, which is the only time performance will really matter). So, the question is, do I delete enumerate_moves(...) and just let other people be faster, or do I leave in the code duplication for the sake of speed? It's an open question for now.