ok, I get your point but surprisingly, when I profile Weini, the evaluation is not that much the bottleneck. Movegenerator and threat detection is taking a lot of time (together with filling and sorting moves).
Code: Select all
14,54% weini [.] EvalOptimDriver
13,83% weini [.] GeneratorHelperCacheSquareNoStat
7,99% weini [.] GetThreadsHelperFast
5,90% weini [.] SortMovesFunctor
5,55% weini [.] Negamax
5,19% weini [.] NegaQuiesce(
5,18% weini [.] Run
3,33% libc-2.19.so [.] malloc
2,80% libc-2.19.so [.] _int_free
2,51% weini [.] Generator
2,43% weini [.] vector<>::emplace_back<Move>
2,40% weini [.] ValidatePawn
2,19% weini [.] SetPiece
2,09% weini [.] ValidateIsCheck
2,02% weini [.] ValidateCheckStatus
2,00% weini [.] GetTTQ
My code for move generatiion (pseudo legal move) is quite classic. What seems to take time is to validate move is not illegal (puts own king in check) during search (GetThreadsHelperFast). For moves management, I've tried using a memorypool or a fixed size container, but I found nothing faster than vector or dequeue.
Still looking for improvement here. I suspect the code is globally to complex and not flat enough.