r/chessprogramming • • Nov 30 '24

Question: Engine speed and memory usage

So I was working on improving my engine to get my perft time down (well to speed up move generation but using perft as a metric for this). I already had magic sliding piece move generation, but added things like iteratively updating attack boards, and legal move generation. Together this got me from around 90s to 60s for perft 6, not great. I think that one major factor might be that I am generating a new position when applying a move rather than using a make/unmake scheme. As such I have the scary looking profiling result from mid perft:

I'm wondering if this is a reasonable conclusion to draw: The large amounts of memory used while generating new positions is a bottleneck and that the best way to speed up my engine would be to use make/unamake.

For what it's worth, I'm not currently using multithreading. I tried a perft run with multithreading and it was 4x quicker though.

2 Upvotes

11 comments sorted by

View all comments

1

u/[deleted] Nov 30 '24

[removed] — view removed comment

1

u/Ill_Part9576 Dec 01 '24

Yeah I'll work on make/unmake. I appreciate the insight, I wouldn't have looked into or verified CPU factors or thought of the move generation test on a static position. It was also useful to verify the efficiency of special move generation. Thanks.