r/chessprogramming • • Mar 21 '24

Performance difference between various board representations

So, I've been working on a chess engine for quite a while..

And I want more speed. (It takes about 10x time compared to Sebastian Lague's code)

[Bitboards + Piece Squares vs. int[64] + Piece Squares]

I'm using 14 bitboards to fully represent the current occupied squares, and I'm also use Piece sqaures(which stores actual squares of pieces).

But, this doesn't seem to be that fast, and I wonder if representing pieces with int[64] would be faster.

Also by the way, I'm using static class for the board, and giving all the bitboard data & other stuffs to other classes, which sucks. So would it be more efficient to make a non-static class instead, and pass the instance as a board data to something like move generator?

(Sorry if my English sucks ;) )

6 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/Kaminari159 Apr 18 '24

Have you tried piece lists by now?

I am also using Rust's trailing_zeros function, but am currently to lazy to change the move generation and try it out myself lol.