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) ?

  • 4
    Surely the answer depends in part on your hardware and what language you are using. Jul 25 '20 at 13:07
  • To be fair those are very impressive figures for a Sinclair ZX81 Spectrum (amazon.co.uk/Original-Sinclair-ZX81-Spectrum-Programming/dp/…).
    – Brian Towers
    Jul 25 '20 at 14:06
  • I know that it depends on many factors, but how good engine do you "expect" to make if you could make one?
    – Ferazhu
    Jul 25 '20 at 19:47
  • 2
    Download and run Stockfish, the strongest conventional program right now, and see how much nps Stockfish gets. That's a good number to compare against.
    – Allure
    Jul 25 '20 at 22:27
  • it's not that much about number of positions analized, but aobut the quality of the analysis
    – David
    Jul 26 '20 at 15:07

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.

  • My educated guess is either the move generator is buggy or its design is (very) sub-optimal. xxxxx Where exactly can I find tips? The only one "general" things is that I found to put everything (regarding moves) into one class and to use long integers rather than arrays, but everything else about chess programming is kinda all over the place.
    – Ferazhu
    Jul 26 '20 at 22:06
  • You asked about how much nps your program should make, and that was the content of my answer (by the way, would you consider to mark your post as answered?). I think if you want to ask a question about how to program a good move generator (which sounds like an interesting one) you should do it opening a new post.
    – emdio
    Aug 2 '20 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.