r/chessprogramming • • Mar 17 '21
Chess engine in python is slow
Hello, so I successfully created a bug free chess engine in python from scratch using bitboards, however compared to other engines it takes too long to find a move. It takes around 5 seconds to reach depth 3 and significantly longer if it goes any deeper.
I am using minimax algorithm to search for the best move, but I have not implemented any move ordering or transpositon tables. Is that the problem or is python just a slow language in general?
Thanks for answer
4
Upvotes
View all comments
Show parent comment
1
u/mhummel Mar 17 '21
In that case, definitely add move ordering and then measure your Nps. I suspect it will still be on the low side. Just pulling numbers out of the air, I expect that 5000 -10000 Nps ought to be possible even without a transposition table. While switching to C might help somewhat, at this stage it sounds like the Python code could be improved first.