I've noticed some conditions that are always true (e.g. https://github.com/official-stockfish/Stockfish/blob/ce73441f2013e0b8fd3eb7a0c9fd391d52adde70/src/search.cpp#L1548 second condition), and I was wondering if removing code like this is in scope for improvements? Or is the speedup from removing these unnecessary checks minor compared to the benefits from having clear constraints on variables at certain steps?
#Removing redundant code for speedup in scope?
10 messages · Page 1 of 1 (latest)
this is assert so it's not compiling into any actual code in executable
so removing it wouldn't be a speedup
yeah this is just a sanity check during debug mode
👍 figured it could be a C thing. Thanks
@vivid harness @hollow kindle What about improving code like this: https://github.com/official-stockfish/Stockfish/blob/ce73441f2013e0b8fd3eb7a0c9fd391d52adde70/src/search.cpp#L319
changing it to something like: pvFirst = pvLast; firstTBRank = rootMoves[pvFirst].tbRank; for (pvLast++; pvLast < rootMoves.size(); pvLast++) if (rootMoves[pvLast].tbRank != firstTBRank) break; }
doubt it's even a speedup but in general this is done only at root which is like 10^-6 of nodes or smth, so is pretty meaningless
Ok but if I found like 10-20 instances of small refactors similar to this could I try submitting a PR and testing?
yes
test first then submit a PR with results of the test