user24210: My program prints time spent on executing a function for doing/retracting move, and both take together an average of 00.0002 seconds. That means my engine can analyze at most 5000 positions per second, right? That doesn't seem to be good, given the branching factor of 30.
How bad is that, and what average/maximum speed could I expect with optimizations (on normal char[64] board) ?

user9179: On my old laptop with an i5 processor, running on a single thread, a recent version of Stockfish (written in CPP) makes around 1 million nodes per second (1Mnps). You must take into account that these nodes are not just the move generator, but the engine is also using its evaluation, so Stockfish's move generator should be much faster than that
My very simple chess engine (written in C), whose move generator is not optimized can make around 4.5Mnps also on a single thread (with no evaluation, just the move generator working. This is what in chess programming is called a perft test).
So at first glance something like some thousands of positions per second seems like very poor performance.
Of course part of this poor performance can be due to the language you've chosen to write your engine, but unless you've made a really weird choice, it seems like there's something odd about your program. My educated guess is either the move generator is buggy or its design is (very) sub-optimal.

user34117: I benchmarked my home made chess engine. It can play 600 000 moves per second in debug mode. It can calculate 80 000 - 100 000 legal moves per second in debug mode (which means that it can calculate and then play around 70 000 legal moves per second in debug mode). However, when running my engine in release mode it is over 10 times faster than in debug mode, meaning that in release mode it can calculate and then play 700 000 legal moves per second.
I made my engine in Rust (if you wrote your engine in Python maybe that's why it is slow), I store the chess position by having an array of chess pieces that store their position. When calculating legal moves I first create another representation of the chessboard, this time I make an 8 by 8 array where every number represents a chess square (this way I can check whether a piece is in the way of another piece in O(1) time instead of in O(n) time).

24210: <p>My program prints time spent on executing a function for doing/retracting move, and both take together an average of 00.0002 seconds. That means my engine can analyze at most 5000 positions per second, right? That doesn't seem to be good, given the branching factor of 30.</p>
<p>How bad is that, and what average/maximum speed could I expect with optimizations (on normal char[64] board) ?</p>
 9179: <p>On my old laptop with an i5 processor, running on a single thread, a recent version of Stockfish (written in CPP) makes around 1 million nodes per second (1Mnps). You must take into account that these nodes are not just the move generator, but the engine is also using its evaluation, so Stockfish's move generator should be much faster than that</p>
<p>My very simple chess engine (written in C), whose move generator is not optimized can make around 4.5Mnps also on a single thread (with no evaluation, just the move generator working. This is what in chess programming is called a <a href="https://www.chessprogramming.org/Perft" rel="nofollow noreferrer">perft test</a>).</p>
<p>So at first glance something like some thousands of positions per second seems like very poor performance.</p>
<p>Of course part of this poor performance can be due to the language you've chosen to write your engine, but unless you've made a really weird choice, it seems like there's something odd about your program. My educated guess is either the move generator is buggy or its design is (very) sub-optimal.</p>
 34117: <p>I benchmarked my home made chess engine. It can play 600 000 moves per second in debug mode. It can calculate 80 000 - 100 000 legal moves per second in debug mode (which means that it can calculate and then play around 70 000 legal moves per second in debug mode). However, when running my engine in release mode it is over 10 times faster than in debug mode, meaning that in release mode it can calculate and then play 700 000 legal moves per second.
I made my engine in Rust (if you wrote your engine in Python maybe that's why it is slow), I store the chess position by having an array of chess pieces that store their position. When calculating legal moves I first create another representation of the chessboard, this time I make an 8 by 8 array where every number represents a chess square (this way I can check whether a piece is in the way of another piece in O(1) time instead of in O(n) time).</p>
