lynx-chess / Lynx

Chess Engine, written in C#
https://lichess.org/@/Lynx_BOT
MIT License
47 stars 4 forks source link

🧠 Use `ArrayPool` to reduce recurrent allocations #983

Closed eduherminio closed 1 month ago

eduherminio commented 2 months ago

Test after Game._moveStack still looking neutral image

Before array pools: before_arraypools

After array pools: arraypools

Test  | perf/arraypool-all-test-only-vs-sb-pool-base
Elo   | 1.64 +- 3.78 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | 2.89 (-2.25, 2.89) [-5.00, 0.00]
Games | 13948: +3959 -3893 =6096
Penta | [348, 1575, 3064, 1637, 350]
https://openbench.lynx-chess.com/test/712/
eduherminio commented 1 month ago

TODO: remove logger.Warn, reevaluate disposals (not quite happening, check vm logs?)