mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Avoid unnecessary creation of accumulator cache
Saves a (currently) 800 KB allocation and deallocation when running `eval`, not particularly significant and zero impact on play but not necessary either. closes https://github.com/official-stockfish/Stockfish/pull/5201 No functional change
This commit is contained in:
parent
5d72032559
commit
eb20de36c0
2 changed files with 3 additions and 2 deletions
1
AUTHORS
1
AUTHORS
|
@ -46,6 +46,7 @@ Bryan Cross (crossbr)
|
|||
candirufish
|
||||
Chess13234
|
||||
Chris Cain (ceebo)
|
||||
Ciekce
|
||||
clefrks
|
||||
Clemens L. (rn5f107s2)
|
||||
Cody Ho (aesrentai)
|
||||
|
|
|
@ -100,11 +100,11 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
|
|||
// Trace scores are from white's point of view
|
||||
std::string Eval::trace(Position& pos, const Eval::NNUE::Networks& networks) {
|
||||
|
||||
auto caches = std::make_unique<Eval::NNUE::AccumulatorCaches>(networks);
|
||||
|
||||
if (pos.checkers())
|
||||
return "Final evaluation: none (in check)";
|
||||
|
||||
auto caches = std::make_unique<Eval::NNUE::AccumulatorCaches>(networks);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << std::showpoint << std::noshowpos << std::fixed << std::setprecision(2);
|
||||
ss << '\n' << NNUE::trace(pos, networks, *caches) << '\n';
|
||||
|
|
Loading…
Add table
Reference in a new issue