]> git.sesse.net Git - stockfish/commit
Use std::stable_sort() instead of std::sort()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 10 Oct 2009 14:29:43 +0000 (15:29 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 10 Oct 2009 14:45:46 +0000 (15:45 +0100)
commite2e249eabd2493e2bb9e5e017aafaac074a706ef
tree2b5355ff21cd68d94dd0d7a416cb013f0f537014
parented19a9f909b5a26dfde49d37c7622b6a385ea18d
Use std::stable_sort() instead of std::sort()

Standard does not mandate std::sort() to be stable, so we
can have, and actually do have different node count on
different platforms.

So use the platform independent std::stable_sort() and gain
same functionality on any platform (Windows, Unix, Mac OS)
and with any compiler (MSVC, gcc or Intel C++).

This sort is teoretically slower, but profiling shows only a very
minimal drop in performance, probably due to the fact that
the set to sort is very small, mainly only captures and with
less frequency non-captures, anyhow we are talking of 30-40 moves
in the worst average case. Sorting alghortims are build to work on
thousands or even milions of elements. With such small sets
performance difference seems not noticable.

After 999 games at 1+0

Mod vs Orig +234 =523 -242 -3 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/move.h
src/movepick.cpp
src/ucioption.cpp