This halves the calls to the costly pos.see_sign(),
speed up is about 1-1.3%
Non functional change.
+int MovePicker::see_sign() const
+{
+ return stage == GOOD_CAPTURES ? 1
+ : stage == BAD_CAPTURES ? -1 : 0;
+}
/// next_move() is the most important method of the MovePicker class. It returns
/// a new pseudo legal move every time it is called, until there are no more moves
/// next_move() is the most important method of the MovePicker class. It returns
/// a new pseudo legal move every time it is called, until there are no more moves
MovePicker(const Position&, Move, Depth, Search::Stack*);
Move next_move();
MovePicker(const Position&, Move, Depth, Search::Stack*);
Move next_move();
private:
template<GenType> void score();
private:
template<GenType> void score();
}
}
else if ( depth < 3 * ONE_PLY
}
}
else if ( depth < 3 * ONE_PLY
- && pos.see_sign(move) < VALUE_ZERO)
+ && ( mp.see_sign() < 0
+ || (!mp.see_sign() && pos.see_sign(move) < VALUE_ZERO)))