Stockfish: Slowdown respect to Official Stockfish

Created on 13 Mar 2017  Â·  32Comments  Â·  Source: ddugovic/Stockfish

Multi Variant Stockfish shows a 15% slowdown respect to Official Stockfish.
Is it this expected?

native build with MSYS2

make profile-build ARCH=x86-64-modern COMP=mingw -j 8

base = official stockfish (bench=5803228)
test = multi-v stockfish (bench=5803228)

run     base    test    diff
  1  2209070  1879892  -329178
  2  2214972  1885389  -329583
  3  2220906  1892768  -328138
  4  2234589  1897099  -337490
  5  2225164  1894622  -330542
  6  2212439  1884164  -328275
  7  2226017  1893385  -332632
  8  2221756  1894003  -327753
  9  2235449  1897099  -338350
 10  2227726  1895241  -332485

base =    2222808 +/- 5765
test =    1891366 +/- 3917
diff =    -331442 +/- 2490
speedup = -0.149110

Most helpful comment

Following the Michael's suggestion, I played with the Makefile flags in 3.2.1 Debugging section.
Slowdown wrt flags kept:
15% All flags
7% -DANTI
4% -DATOMIC
4% -DCRAZYHOUSE
1% No flags

So in fishtest should be possible to have builds for the variant tested, gaining 10% of CPU power.

All 32 comments

It's been that way for a while. You can reduce the slowdown by just compiling for the variant version that interests you. Not sure if is possible to fix. The latest version of SugaR has the opposite dynamic , it's about 5% faster than official SF

Sent from my iPhone

On Mar 13, 2017, at 2:15 PM, ppigazzini notifications@github.com wrote:

Multi Variant Stockfish shows a 15% slowdown respect to Official Stockfish.
Is it this expected?

native build with MSYS2
make profile-build ARCH=x86-64-modern COM=mingw -j 8

base = official stockfish (bench=5803228)
test = multi-v stockfish (bench=5803228)

run base test diff
1 2209070 1879892 -329178
2 2214972 1885389 -329583
3 2220906 1892768 -328138
4 2234589 1897099 -337490
5 2225164 1894622 -330542
6 2212439 1884164 -328275
7 2226017 1893385 -332632
8 2221756 1894003 -327753
9 2235449 1897099 -338350
10 2227726 1895241 -332485

base = 2222808 +/- 5765
test = 1891366 +/- 3917
diff = -331442 +/- 2490
speedup = -0.149110

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Yes, this is expected and known. It is difficult to add the functionality for variants without introducing slowdowns for standard chess.

Following the Michael's suggestion, I played with the Makefile flags in 3.2.1 Debugging section.
Slowdown wrt flags kept:
15% All flags
7% -DANTI
4% -DATOMIC
4% -DCRAZYHOUSE
1% No flags

So in fishtest should be possible to have builds for the variant tested, gaining 10% of CPU power.

Thanks for the statistics @ppigazzini . I see (bench, all flags):

Total time (ms) : 8740
Nodes searched  : 5803228
Nodes/second    : 663984

versus without -DANTI:

Total time (ms) : 8263
Nodes searched  : 5803228
Nodes/second    : 702314

@ddugovic if I'm not wrong without -DANTI you should get a build working for all versions except antichess: more interesting a build with only -DANTI (as my statistics)

here the bash script to bench two builds of stockfish (mind the ./ before the build name)
[EDITED: check below the script debugged by @ianfab ]

My main concern at the moment is what, if anything, can be done for Lichess given that 1% of players play antichess and the other 99% may appreciate a speedup. So I find my test more interesting; it may be possible to speed up Stockfish while leaving antichess intact.

(Currently I am looking at movegen.cpp to see if template functions improve performance.)

Here are my results with that script:

run   1 / 10
run   2 / 10
run   3 / 10
run   4 / 10
run   5 / 10
run   6 / 10
run   7 / 10
run   8 / 10
run   9 / 10
run  10 / 10

run     base    test    diff
  1  660734  0  -660734
  2  624540  0  -624540
  3  670350  0  -670350
  4  675265  0  -675265
  5  675579  0  -675579
  6  664669  0  -664669
  7  627511  0  -627511
  8  614423  0  -614423
  9  622931  0  -622931
 10  635552  0  -635552

base =     647155 +/- 15880
test =          0 +/- 0
diff =    -647155 +/- 15880
speedup = -1.000000

So in fishtest should be possible to have builds for the variant tested, gaining 10% of CPU power.

10% slow down means around -12 Elo points.
For an engines at top humans level, -12 Elo is not a big thing.

@Vinvin20 there are only 3 active contributors of CPU: ddugovic, ianfab and me. So a 10% of speedup in fishtest, IMO, is useful.

@ddugovic the third column is 0, I think that you have forgotten the ./ before the second build :)

$ bash bench-parallel.sh  ./stockfish-base.exe  ./stockfish-test.exe  10

base = all flags
test = without -DANTI -DSUICIDE

run     base    test    diff
  1  1894622  1964532  +69910
  2  1890918  1965863  +74945
  3  1899583  1968530  +68947
  4  1902074  1972545  +70471
  5  1889071  1959226  +70155
  6  1894622  1970535  +75913
  7  1904571  1969866  +65295
  8  1890302  1961212  +70910
  9  1901450  1972545  +71095
 10  1899583  1972545  +72962

base =    1896679 +/- 3586
test =    1967739 +/- 3164
diff =      71060 +/- 1977
speedup = 0.037466

I had similar strange results like @ddugovic. I think that this is due to overwriting of the temporary files with pipes from the same files, which can, as far as I know, cause undefined behaviour. A slightly modified version of the script works for me.

@ianfab thank you :)

The time control for fishtest is fixed, though, no? So it would use the alloted time more efficiently, but not finish faster. In that case I am in favor of testing with all variants enabled, because that's the version most people will use.

@ianfab Is fishtest power a bottleneck for you currently? I think I can contribute a couple of instances if so (and if I can figure out how to set them up).

@niklasf Currently, the bottleneck is the creation of patches and tests, especially of those that are not simply parameter tweaks.

@niklasf the time control is scaled according to the bench time of the worker. So in this moment each test use 10% more time than strictly necessary.

@ianfab the project needs also more workers 1. the worker pool must have more variability to avoid ovefitting 2. the regression tests are performed with only 1000 games, the error bar is high and the gain of that latest patches is masked 3. a developer wants the test result asap :)

@ppigazzini Sure, it is nice to have more workers and I very much appreciate any contribution of CPU time, but the machines need meaningful tests to work on. Many of my ideas have already been tested (or at least certain implementations of them), and I currently have less time to write patches, so any contribution of patches and tests is very welcome.

Well... it seems 2c5969d1a04e9e41fb1ab8a10190854ebd769d46 and 1e57268132032a1ec4549ba8aeadd78cc858f9e1 are a 1.2% speedup on my machine in 40 iterations, and ~at least for standard chess~ the benchmark numbers are the same... test submitted.

Apparently I don't know how to properly submit the test for branch versus master with speedup bounds (no functional change).

@ddugovic I think that for patches with no functional change we only need to verify the speed-up on a few machines. A test would probably fail anyway if the speed-up is smaller than 4-5%. On my machine the speed-up is smaller, but still there:

diff =       5596 +/- 3375
speedup = 0.003547

Regarding the test submission: I think this problem with one branch tested against itself occurs when you select the test type "regression", so please use "standard" for any kind of test.

It would be nice to have the possibility of doing speed measurements on fishtest, but I think it will not be added upstream soon and I do not know whether or when I will be able to add it myself.

Thanks, that makes sense and all my tests with this change have been positive.

I suppose next I'll use callgrind or similar to look for other room for optimization.

Callgrind annotation without/with -DANTI (excerpt):

-------------------------------------------------------------   -------------------------------------------------------------
Profile data file 'callgrind.out.18478' (creator: callgrind-3 | Profile data file 'callgrind.out.18832' (creator: callgrind-3
-------------------------------------------------------------   -------------------------------------------------------------
I1 cache:                                                       I1 cache: 
D1 cache:                                                       D1 cache: 
LL cache:                                                       LL cache: 
Timerange: Basic block 0 - 3067735945                         | Timerange: Basic block 0 - 3325791624
Trigger: Program termination                                    Trigger: Program termination
Profiled target:  ./stockfish_base bench (PID 18478, part 1)  | Profiled target:  ./stockfish bench (PID 18832, part 1)
Events recorded:  Ir                                            Events recorded:  Ir
Events shown:     Ir                                            Events shown:     Ir
Event sort order: Ir                                            Event sort order: Ir
Thresholds:       99                                            Thresholds:       99
Include dirs:                                                   Include dirs:     
User annotated:                                                 User annotated:   
Auto-annotation:  off                                           Auto-annotation:  off

-------------------------------------------------------------   -------------------------------------------------------------
            Ir                                                              Ir 
-------------------------------------------------------------   -------------------------------------------------------------
19,101,514,352  PROGRAM TOTALS                                | 20,222,342,852  PROGRAM TOTALS

-------------------------------------------------------------   -------------------------------------------------------------
           Ir  file:function                                               Ir  file:function
-------------------------------------------------------------   -------------------------------------------------------------
1,823,907,316  search.cpp:Value (anonymous namespace)::search | 2,047,873,044  search.cpp:Value (anonymous namespace)::search
1,467,929,891  movepick.cpp:MovePicker::next_move() [/home/li | 1,502,438,085  movepick.cpp:MovePicker::next_move() [/home/li
1,345,721,132  evaluate.cpp:Value Eval::evaluate<false>(Posit | 1,405,249,353  evaluate.cpp:Value Eval::evaluate<false>(Posit
1,028,670,253  evaluate.cpp:Score (anonymous namespace)::eval | 1,099,081,913  evaluate.cpp:Score (anonymous namespace)::eval
  819,019,917  position.cpp:Position::see_ge(Move, Value) con |   974,217,760  position.cpp:Position::see_ge(Move, Value) con
  677,130,431  position.cpp:Position::do_move(Move, StateInfo |   708,334,202  position.cpp:Position::do_move(Move, StateInfo
  400,707,071  types.h:Value Eval::evaluate<false>(Position c |   404,208,276  types.h:Value (anonymous namespace)::search<((
  388,975,638  types.h:Value (anonymous namespace)::search<(( |   388,129,706  types.h:Value Eval::evaluate<false>(Position c
  362,780,583  position.cpp:Position::set_check_info(StateInf |   332,939,118  types.h:MovePicker::next_move()
  273,765,607  position.h:Score (anonymous namespace)::evalua |   318,033,272  position.h:Score (anonymous namespace)::evalua
  268,173,002  types.h:MovePicker::next_move()                |   269,559,168  position.cpp:Position::set_check_info(StateInf
  238,721,072  pawns.cpp:Pawns::probe(Position const&) [/home |   238,721,072  pawns.cpp:Pawns::probe(Position const&) [/home
  231,781,071  bitboard.h:Score (anonymous namespace)::evalua |   237,370,744  bitboard.h:Score (anonymous namespace)::evalua
  229,485,444  movepick.h:MovePicker::next_move()             |   230,445,283  position.cpp:Position::legal(Move) const [/hom
  224,727,989  types.h:Score (anonymous namespace)::evaluate_ |   226,069,023  types.h:Score (anonymous namespace)::evaluate_
  222,662,625  tt.cpp:TranspositionTable::probe(unsigned long     222,662,625  tt.cpp:TranspositionTable::probe(unsigned long
  221,360,877  types.h:Position::see_ge(Move, Value) const    |   218,423,148  position.cpp:Position::slider_blockers(unsigne
  211,631,064  types.h:Position::do_move(Move, StateInfo&, bo |   211,876,496  types.h:Position::do_move(Move, StateInfo&, bo
  210,642,044  position.cpp:Position::undo_move(Move) [/home/ |   211,862,059  movepick.h:MovePicker::next_move()
  202,386,454  position.cpp:Position::legal(Move) const [/hom |   210,773,064  position.cpp:Position::undo_move(Move) [/home/
  199,485,927  search.cpp:Value (anonymous namespace)::qsearc |   209,014,768  search.cpp:Value (anonymous namespace)::qsearc
  191,653,835  position.h:Position::is_variant_end() const [/ |   200,704,071  types.h:Position::see_ge(Move, Value) const
  179,179,003  types.h:Position::moved_piece(Move) const [/ho |   191,653,835  position.h:Position::is_variant_end() const [/
  167,353,122  position.h:Position::set_check_info(StateInfo* |   179,179,003  types.h:Position::moved_piece(Move) const [/ho
  165,487,973  bitboard.h:Value Eval::evaluate<false>(Positio |   164,403,431  position.h:Position::capture_or_promotion(Move
  164,403,431  position.h:Position::capture_or_promotion(Move |   160,712,147  position.cpp:Position::is_draw(int) const [/ho
  160,712,147  position.cpp:Position::is_draw(int) const [/ho |   159,870,452  bitboard.h:Value Eval::evaluate<false>(Positio
  155,776,287  types.h:Position::advanced_pawn_push(Move) con |   155,776,540  types.h:Position::advanced_pawn_push(Move) con
  142,735,866  position.cpp:Position::attackers_to(Square, un |   146,522,445  movepick.cpp:void MovePicker::score<(GenType)0
                                                              >   142,527,868  position.cpp:Position::attackers_to(Square, un
  142,409,336  /usr/include/c++/6/bits/stl_algo.h:MovePicker:     142,409,336  /usr/include/c++/6/bits/stl_algo.h:MovePicker:
  136,230,679  search.cpp:Value (anonymous namespace)::qsearc |   141,976,445  search.cpp:Value (anonymous namespace)::qsearc
                                                              >   139,408,742  types.h:Position::undo_move(Move)
  135,630,568  position.h:Position::undo_move(Move)               135,630,568  position.h:Position::undo_move(Move)
  134,186,779  movepick.cpp:void MovePicker::score<(GenType)0 |   133,134,246  position.h:Position::do_move(Move, StateInfo&,
  133,921,248  position.h:Position::do_move(Move, StateInfo&, <
  130,625,208  position.cpp:Position::key_after(Move) const       130,625,208  position.cpp:Position::key_after(Move) const
  125,698,385  types.h:Position::undo_move(Move)              |   121,028,040  evaluate.cpp:void (anonymous namespace)::eval_
  118,647,825  position.h:Position::advanced_pawn_push(Move)  |   118,647,825  position.h:Position::advanced_pawn_push(Move) 
  115,494,897  pawns.cpp:Value Pawns::Entry::shelter_storm<(C |   118,146,420  evaluate.cpp:void (anonymous namespace)::eval_
                                                              >   115,494,897  pawns.cpp:Value Pawns::Entry::shelter_storm<(C
                                                              >   111,850,866  position.h:Square Position::square<(PieceType)
                                                              >   111,738,026  position.h:Square Position::square<(PieceType)
  107,499,981  position.h:Position::moved_piece(Move) const       107,499,981  position.h:Position::moved_piece(Move) const
  103,391,548  bitboard.h:Position::see_ge(Move, Value) const |   102,967,189  evaluate.cpp:(anonymous namespace)::evaluate_s
  102,967,189  evaluate.cpp:(anonymous namespace)::evaluate_s |   101,805,620  position.h:Position::attackers_to(Square, unsi
  101,954,190  position.h:Position::attackers_to(Square, unsi |    96,562,406  pawns.cpp:Value Pawns::Entry::shelter_storm<(C
   98,215,047  types.h:Position::legal(Move) const            |    96,308,567  types.h:Position::legal(Move) const
   96,562,406  pawns.cpp:Value Pawns::Entry::shelter_storm<(C |    94,505,700  position.h:Value (anonymous namespace)::search
   94,505,700  position.h:Value (anonymous namespace)::search |    94,150,528  search.cpp:Value (anonymous namespace)::search
   90,787,890  search.cpp:Value (anonymous namespace)::search |    94,092,828  position.cpp:Position::pseudo_legal(Move) cons
   90,134,132  position.cpp:Position::pseudo_legal(Move) cons |    93,655,034  search.cpp:Value (anonymous namespace)::search
   87,982,702  position.h:Value Eval::evaluate<false>(Positio |    90,999,762  position.h:Square Position::square<(PieceType)
   85,864,665  evaluate.cpp:(anonymous namespace)::evaluate_i |    88,746,285  evaluate.cpp:(anonymous namespace)::evaluate_i
   85,763,351  search.cpp:Value (anonymous namespace)::search |    88,102,235  bitboard.h:Position::see_ge(Move, Value) const
   81,771,687  movegen.cpp:ExtMove* generate<(GenType)0>(Posi |    87,828,849  movegen.cpp:ExtMove* generate<(GenType)0>(Posi
                                                              >    84,611,315  position.h:Value Eval::evaluate<false>(Positio
   81,245,192  /usr/include/x86_64-linux-gnu/bits/string3.h:P      81,245,192  /usr/include/x86_64-linux-gnu/bits/string3.h:P
   77,967,112  tt.h:Value (anonymous namespace)::search<((ano |    77,967,133  tt.h:Value (anonymous namespace)::search<((ano
   73,788,450  material.cpp:Material::probe(Position const&)  |    74,130,514  material.cpp:Material::probe(Position const&) 
   73,206,236  evaluate.cpp:void (anonymous namespace)::eval_ |    73,183,733  types.h:Position::capture_or_promotion(Move) c
   73,179,804  types.h:Position::capture_or_promotion(Move) c <
   73,127,178  position.h:Square Position::square<(PieceType) <
   70,577,768  bitbase.cpp:main                                    70,577,768  bitbase.cpp:main
   68,082,612  types.h:Position::key_after(Move) const [/home |    68,082,612  types.h:Position::key_after(Move) const [/home
   67,508,258  evaluate.cpp:void (anonymous namespace)::eval_ |    66,150,829  pawns.h:Value Eval::evaluate<false>(Position c
   67,477,093  pawns.h:Value Eval::evaluate<false>(Position c |    65,820,816  types.h:(anonymous namespace)::update_cm_stats
   66,320,583  bitboard.h:Position::set_check_info(StateInfo* |    63,587,304  movegen.cpp:ExtMove* (anonymous namespace)::ge
   65,820,120  types.h:(anonymous namespace)::update_cm_stats <
   61,983,376  movegen.cpp:ExtMove* (anonymous namespace)::ge <
   61,678,330  types.h:void MovePicker::score<(GenType)0>()        61,678,330  types.h:void MovePicker::score<(GenType)0>()
   56,062,813  pawns.h:Score (anonymous namespace)::evaluate_ |    56,982,187  movegen.cpp:ExtMove* generate<(GenType)1>(Posi
   55,635,734  movegen.cpp:ExtMove* generate<(GenType)1>(Posi |    56,062,813  pawns.h:Score (anonymous namespace)::evaluate_
   52,538,111  pawns.cpp:Score Pawns::Entry::do_king_safety<( |    53,854,561  movegen.cpp:ExtMove* (anonymous namespace)::ge
   52,429,908  movegen.cpp:ExtMove* (anonymous namespace)::ge |    52,538,111  pawns.cpp:Score Pawns::Entry::do_king_safety<(
   52,282,384  /usr/include/c++/6/bits/move.h:MovePicker::nex      52,282,384  /usr/include/c++/6/bits/move.h:MovePicker::nex
   50,020,384  search.cpp:Value (anonymous namespace)::qsearc |    51,753,377  position.h:Position::see_ge(Move, Value) const
                                                              >    50,952,588  position.h:Position::slider_blockers(unsigned 
                                                              >    50,510,031  search.cpp:Value (anonymous namespace)::qsearc
                                                              >    50,020,384  search.cpp:Value (anonymous namespace)::qsearc
   49,519,542  bitboard.h:Pawns::probe(Position const&)            49,519,542  bitboard.h:Pawns::probe(Position const&)
   49,235,881  search.cpp:Value (anonymous namespace)::qsearc |    48,987,540  position.h:(anonymous namespace)::evaluate_ini
   47,059,357  types.h:(anonymous namespace)::update_stats(Po |    47,858,245  movegen.cpp:ExtMove* generate<(GenType)3>(Posi
   46,451,730  bitboard.h:Value (anonymous namespace)::search |    47,059,464  types.h:(anonymous namespace)::update_stats(Po
   46,354,221  movegen.cpp:ExtMove* generate<(GenType)3>(Posi |    46,451,730  bitboard.h:Value (anonymous namespace)::search
   46,105,920  position.h:(anonymous namespace)::evaluate_ini |    45,239,908  movegen.cpp:ExtMove* (anonymous namespace)::ge
   45,239,908  movegen.cpp:ExtMove* (anonymous namespace)::ge |    44,542,936  types.h:Value (anonymous namespace)::qsearch<(
   44,542,036  types.h:Value (anonymous namespace)::qsearch<( |    43,693,450  pawns.cpp:Score Pawns::Entry::do_king_safety<(
   43,693,450  pawns.cpp:Score Pawns::Entry::do_king_safety<( |    43,234,964  movepick.cpp:Value (anonymous namespace)::sear
   42,970,005  movepick.cpp:Value (anonymous namespace)::sear |    42,884,394  position.h:Position::set_check_info(StateInfo*
   41,779,159  movegen.cpp:ExtMove* (anonymous namespace)::ge |    41,779,159  movegen.cpp:ExtMove* (anonymous namespace)::ge
   40,781,676  bitboard.h:Position::attackers_to(Square, unsi |    41,288,400  types.h:Position::pseudo_legal(Move) const
   40,752,954  position.h:Position::remove_piece(Piece, Squar      40,752,954  position.h:Position::remove_piece(Piece, Squar
   40,486,359  movepick.h:Value (anonymous namespace)::search |    40,722,248  bitboard.h:Position::attackers_to(Square, unsi
   40,428,896  search.cpp:Value (anonymous namespace)::qsearc |    40,479,377  movepick.h:Value (anonymous namespace)::search
   39,162,615  movepick.cpp:MovePicker::MovePicker(Position c |    40,428,896  search.cpp:Value (anonymous namespace)::qsearc
   38,930,480  evaluate.cpp:Score (anonymous namespace)::eval |    39,099,783  movepick.cpp:MovePicker::MovePicker(Position c
   37,957,218  evaluate.cpp:Score (anonymous namespace)::eval |    38,930,480  evaluate.cpp:Score (anonymous namespace)::eval
   37,497,188  movegen.cpp:ExtMove* (anonymous namespace)::ge |    37,957,218  evaluate.cpp:Score (anonymous namespace)::eval
   35,179,240  types.h:Position::pseudo_legal(Move) const     |    37,497,188  movegen.cpp:ExtMove* (anonymous namespace)::ge
   34,660,420  movegen.cpp:ExtMove* (anonymous namespace)::ge |    36,758,052  bitboard.h:Position::set_check_info(StateInfo*
   34,533,043  movegen.cpp:ExtMove* (anonymous namespace)::ge |    36,378,876  movegen.cpp:MovePicker::next_move()
   34,145,599  movegen.cpp:ExtMove* (anonymous namespace)::ge |    34,660,420  movegen.cpp:ExtMove* (anonymous namespace)::ge
   33,588,948  movegen.cpp:MovePicker::next_move()            |    34,533,043  movegen.cpp:ExtMove* (anonymous namespace)::ge
   33,190,128  movegen.cpp:ExtMove* (anonymous namespace)::ge |    34,145,599  movegen.cpp:ExtMove* (anonymous namespace)::ge
   33,060,065  bitboard.h:Position::undo_move(Move)           |    33,190,128  movegen.cpp:ExtMove* (anonymous namespace)::ge
   32,511,553  position.h:Position::legal(Move) const              32,511,553  position.h:Position::legal(Move) const
   31,821,730  tt.h:TranspositionTable::probe(unsigned long,  |    31,821,730  tt.h:TranspositionTable::probe(unsigned long, 
   31,736,690  movepick.h:(anonymous namespace)::update_stats |    31,736,690  movepick.h:(anonymous namespace)::update_stats
   31,266,079  position.h:Position::see_ge(Move, Value) const |    31,697,820  position.h:void (anonymous namespace)::eval_in
   30,440,346  movegen.cpp:ExtMove* (anonymous namespace)::ge |    30,440,346  movegen.cpp:ExtMove* (anonymous namespace)::ge
   29,972,110  search.cpp:(anonymous namespace)::update_stats |    29,972,110  search.cpp:(anonymous namespace)::update_stats
   29,484,143  types.h:Value (anonymous namespace)::qsearch<( |    29,838,203  position.h:Position::capture(Move) const [/hom
   28,479,823  tt.h:Value (anonymous namespace)::qsearch<((an |    29,562,531  bitboard.h:Position::slider_blockers(unsigned 
   27,739,596  position.h:Square Position::square<(PieceType) |    29,484,272  types.h:Value (anonymous namespace)::qsearch<(
   27,479,364  position.h:Square Position::square<(PieceType) |    28,816,200  position.h:void (anonymous namespace)::eval_in
   26,599,135  position.h:Position::capture(Move) const [/hom |    28,816,200  types.h:(anonymous namespace)::evaluate_initia
   25,934,580  types.h:(anonymous namespace)::evaluate_initia |    27,994,762  /build/glibc-t3gR2i/glibc-2.23/string/../sysde
   25,934,580  position.h:void (anonymous namespace)::eval_in |    27,963,954  tt.h:Value (anonymous namespace)::qsearch<((an
   25,758,793  types.h:Pawns::probe(Position const&)               25,758,793  types.h:Pawns::probe(Position const&)
   25,635,402  /build/glibc-t3gR2i/glibc-2.23/string/../sysde <
   24,750,344  position.h:Position::key_after(Move) const          24,750,344  position.h:Position::key_after(Move) const
   24,535,358  bitboard.h:Value Pawns::Entry::shelter_storm<( |    24,535,358  bitboard.h:Value Pawns::Entry::shelter_storm<(
   24,505,368  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in      24,505,368  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in
   23,289,270  movepick.h:(anonymous namespace)::update_cm_st |    23,289,270  movepick.h:(anonymous namespace)::update_cm_st
   23,052,960  position.h:void (anonymous namespace)::eval_in |    23,020,240  bitboard.h:void (anonymous namespace)::eval_in
   22,751,543  types.h:Value (anonymous namespace)::search<(( |    22,640,530  bitboard.h:Position::remove_piece(Piece, Squar
   22,640,530  bitboard.h:Position::remove_piece(Piece, Squar |    22,438,545  types.h:Value (anonymous namespace)::search<((
   22,262,730  types.h:Position::set_check_info(StateInfo*) c |    22,235,217  position.cpp:Score (anonymous namespace)::eval
   22,235,217  position.cpp:Score (anonymous namespace)::eval |    21,650,746  tt.h:Value (anonymous namespace)::qsearch<((an
   22,079,282  tt.h:Value (anonymous namespace)::qsearch<((an |    21,546,053  bitboard.h:Position::undo_move(Move)
   20,977,004  material.h:(anonymous namespace)::evaluate_sca |    20,977,004  material.h:(anonymous namespace)::evaluate_sca
   20,745,747  position.h:(anonymous namespace)::evaluate_sca |    20,745,747  position.h:(anonymous namespace)::evaluate_sca
   20,726,525  types.h:Value (anonymous namespace)::search<(( |    20,670,999  movegen.cpp:ExtMove* (anonymous namespace)::ge
   20,670,999  movegen.cpp:ExtMove* (anonymous namespace)::ge |    20,460,860  types.h:Value (anonymous namespace)::search<((
   20,390,838  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in |    20,361,124  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in
   20,138,620  bitboard.h:void (anonymous namespace)::eval_in |    19,975,465  bitboard.h:void (anonymous namespace)::eval_in
   19,975,465  bitboard.h:void (anonymous namespace)::eval_in |    19,775,653  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in
   19,775,653  /usr/lib/gcc/x86_64-linux-gnu/6/include/bmi2in |    18,726,148  types.h:Value Pawns::Entry::shelter_storm<(Col
   18,726,148  types.h:Value Pawns::Entry::shelter_storm<(Col <
   18,687,822  /usr/include/c++/6/bits/stl_vector.h:Pawns::pr      18,687,822  /usr/include/c++/6/bits/stl_vector.h:Pawns::pr
   18,669,909  /build/glibc-t3gR2i/glibc-2.23/math/../sysdeps      18,669,909  /build/glibc-t3gR2i/glibc-2.23/math/../sysdeps
   18,545,722  position.h:Value (anonymous namespace)::qsearc |    18,545,722  position.h:Value (anonymous namespace)::qsearc
   17,048,198  movegen.cpp:ExtMove* (anonymous namespace)::ge |    18,379,026  types.h:Position::set_check_info(StateInfo*) c
                                                              >    17,048,198  movegen.cpp:ExtMove* (anonymous namespace)::ge
                                                              >    16,979,270  movegen.cpp:ExtMove* (anonymous namespace)::ge
   16,700,565  /usr/include/c++/6/bits/stl_algobase.h:Value E      16,700,565  /usr/include/c++/6/bits/stl_algobase.h:Value E
   16,077,483  bitboard.h:ExtMove* (anonymous namespace)::gen      16,077,483  bitboard.h:ExtMove* (anonymous namespace)::gen
                                                              >    15,448,444  position.cpp:Position::gives_check(Move) const
   15,260,698  bitboard.h:ExtMove* (anonymous namespace)::gen      15,260,698  bitboard.h:ExtMove* (anonymous namespace)::gen
   14,757,600  /usr/include/x86_64-linux-gnu/bits/string3.h:V |    14,757,600  /usr/include/x86_64-linux-gnu/bits/string3.h:V
   14,321,462  position.cpp:Position::gives_check(Move) const |    14,754,108  types.h:Position::capture(Move) const
   14,143,098  bitboard.h:ExtMove* (anonymous namespace)::gen      14,143,098  bitboard.h:ExtMove* (anonymous namespace)::gen
                                                              >    14,142,865  position.h:ExtMove* (anonymous namespace)::gen
                                                              >    13,799,313  position.h:Square Position::square<(PieceType)
   13,584,318  types.h:Position::remove_piece(Piece, Square)       13,584,318  types.h:Position::remove_piece(Piece, Square)
   13,448,799  types.h:Position::capture(Move) const          |    13,454,304  movegen.cpp:ExtMove* (anonymous namespace)::ge
   13,431,808  search.cpp:Value (anonymous namespace)::qsearc |    13,431,808  search.cpp:Value (anonymous namespace)::qsearc
   13,221,465  bitboard.h:ExtMove* generate<(GenType)1>(Posit      13,221,465  bitboard.h:ExtMove* generate<(GenType)1>(Posit
   13,221,327  movegen.cpp:ExtMove* (anonymous namespace)::ge |    13,221,327  movegen.cpp:ExtMove* (anonymous namespace)::ge
   13,094,646  bitboard.h:ExtMove* generate<(GenType)3>(Posit      13,094,646  bitboard.h:ExtMove* generate<(GenType)3>(Posit
   12,920,501  movegen.cpp:ExtMove* generate<(GenType)5>(Posi |    13,001,173  movegen.cpp:ExtMove* generate<(GenType)5>(Posi
   12,775,706  movegen.cpp:ExtMove* (anonymous namespace)::ge <
   12,665,928  /usr/include/c++/6/bits/stl_vector.h:Material:      12,665,928  /usr/include/c++/6/bits/stl_vector.h:Material:
   12,538,937  position.h:ExtMove* (anonymous namespace)::gen |    12,398,366  position.h:ExtMove* (anonymous namespace)::gen
   12,273,001  movegen.cpp:ExtMove* (anonymous namespace)::ge |    12,273,001  movegen.cpp:ExtMove* (anonymous namespace)::ge
   12,229,352  movegen.cpp:ExtMove* (anonymous namespace)::ge |    12,229,352  movegen.cpp:ExtMove* (anonymous namespace)::ge
   12,192,996  movegen.cpp:ExtMove* (anonymous namespace)::ge |    12,192,996  movegen.cpp:ExtMove* (anonymous namespace)::ge
   12,178,850  bitboard.h:ExtMove* (anonymous namespace)::gen      12,178,850  bitboard.h:ExtMove* (anonymous namespace)::gen
   12,074,535  /usr/include/c++/6/bits/stl_vector.h:Position:      12,074,535  /usr/include/c++/6/bits/stl_vector.h:Position:
   11,954,583  position.h:Position::pseudo_legal(Move) const  |    11,875,692  /usr/include/c++/6/bits/stl_algobase.h:Value (
   11,816,571  position.h:Value (anonymous namespace)::qsearc |    11,816,571  position.h:Value (anonymous namespace)::qsearc
   11,432,069  types.h:Value Pawns::Entry::shelter_storm<(Col |    11,432,069  types.h:Value Pawns::Entry::shelter_storm<(Col
   11,384,551  types.h:Value (anonymous namespace)::qsearch<( |    11,371,533  types.h:Value (anonymous namespace)::qsearch<(
   11,287,953  position.h:Square Position::square<(PieceType) <
   11,143,558  bitboard.h:main                                     11,143,558  bitboard.h:main
   11,078,223  bitboard.h:ExtMove* (anonymous namespace)::gen      11,078,223  bitboard.h:ExtMove* (anonymous namespace)::gen
   10,984,637  position.h:void MovePicker::score<(GenType)0>(      10,984,637  position.h:void MovePicker::score<(GenType)0>(
   10,973,713  position.h:ExtMove* (anonymous namespace)::gen <
   10,752,897  bitboard.h:ExtMove* (anonymous namespace)::gen      10,752,897  bitboard.h:ExtMove* (anonymous namespace)::gen
   10,707,811  bitboard.h:attacks_bb(Piece, Square, unsigned       10,707,811  bitboard.h:attacks_bb(Piece, Square, unsigned 
   10,342,218  movegen.cpp:ExtMove* (anonymous namespace)::ge |    10,146,348  search.cpp:(anonymous namespace)::update_cm_st
   10,146,348  search.cpp:(anonymous namespace)::update_cm_st |    10,131,676  movegen.cpp:ExtMove* (anonymous namespace)::ge
   10,131,676  movegen.cpp:ExtMove* (anonymous namespace)::ge |    10,066,751  search.cpp:Value (anonymous namespace)::qsearc

Callgrind annotation using --inclusive=yes without/with -DANTI (complete):

-------------------------------------------------------------   -------------------------------------------------------------
Profile data file 'callgrind.out.18478' (creator: callgrind-3 | Profile data file 'callgrind.out.18832' (creator: callgrind-3
-------------------------------------------------------------   -------------------------------------------------------------
I1 cache:                                                       I1 cache: 
D1 cache:                                                       D1 cache: 
LL cache:                                                       LL cache: 
Timerange: Basic block 0 - 3067735945                         | Timerange: Basic block 0 - 3325791624
Trigger: Program termination                                    Trigger: Program termination
Profiled target:  ./stockfish_base bench (PID 18478, part 1)  | Profiled target:  ./stockfish bench (PID 18832, part 1)
Events recorded:  Ir                                            Events recorded:  Ir
Events shown:     Ir                                            Events shown:     Ir
Event sort order: Ir                                            Event sort order: Ir
Thresholds:       99                                            Thresholds:       99
Include dirs:                                                   Include dirs:     
User annotated:                                                 User annotated:   
Auto-annotation:  off                                           Auto-annotation:  off

-------------------------------------------------------------   -------------------------------------------------------------
            Ir                                                              Ir 
-------------------------------------------------------------   -------------------------------------------------------------
19,101,514,352  PROGRAM TOTALS                                | 20,222,342,852  PROGRAM TOTALS

-------------------------------------------------------------   -------------------------------------------------------------
            Ir  file:function                                               Ir  file:function
-------------------------------------------------------------   -------------------------------------------------------------
83,536,425,237  search.cpp:Value (anonymous namespace)::searc | 88,442,985,321  search.cpp:Value (anonymous namespace)::searc
82,243,617,426  search.cpp:Value (anonymous namespace)::searc | 87,091,990,499  search.cpp:Value (anonymous namespace)::searc
18,967,523,598  /build/glibc-t3gR2i/glibc-2.23/nptl/pthread_c | 20,085,885,299  /build/glibc-t3gR2i/glibc-2.23/nptl/pthread_c
18,967,516,050  /home/lila/fishnet/Stockfish/src/thread.cpp:r | 20,085,877,751  /home/lila/fishnet/Stockfish/src/thread.cpp:r
18,967,512,372  thread.cpp:run_idle_loop(void*) [/home/lila/f | 20,085,874,098  thread.cpp:run_idle_loop(void*) [/home/lila/f
18,967,500,641  /home/lila/fishnet/Stockfish/src/search.cpp:M | 20,085,862,378  /home/lila/fishnet/Stockfish/src/search.cpp:M
18,921,866,756  search.cpp:MainThread::search() [/home/lila/f | 20,040,232,737  search.cpp:MainThread::search() [/home/lila/f
18,921,749,845  search.cpp:Thread::search() [/home/lila/fishn | 20,040,119,161  search.cpp:Thread::search() [/home/lila/fishn
18,899,976,702  search.cpp:Value (anonymous namespace)::searc | 20,018,021,858  search.cpp:Value (anonymous namespace)::searc
18,353,502,835  search.cpp:Value (anonymous namespace)::searc | 19,445,750,061  search.cpp:Value (anonymous namespace)::searc
 6,930,460,002  search.cpp:Value (anonymous namespace)::qsear |  7,304,268,360  search.cpp:Value (anonymous namespace)::qsear
 6,853,866,289  search.cpp:Value (anonymous namespace)::qsear |  7,227,674,647  search.cpp:Value (anonymous namespace)::qsear
 5,598,954,686  /home/lila/fishnet/Stockfish/src/evaluate.cpp |  5,949,327,779  /home/lila/fishnet/Stockfish/src/evaluate.cpp
 5,078,325,439  search.cpp:Value (anonymous namespace)::qsear |  5,344,881,244  search.cpp:Value (anonymous namespace)::qsear
 5,016,418,692  search.cpp:Value (anonymous namespace)::qsear |  5,282,974,497  search.cpp:Value (anonymous namespace)::qsear
 4,426,260,340  evaluate.cpp:Value Eval::evaluate<false>(Posi |  4,798,007,064  evaluate.cpp:Value Eval::evaluate<false>(Posi
 4,066,481,658  /home/lila/fishnet/Stockfish/src/movepick.cpp |  4,225,879,132  /home/lila/fishnet/Stockfish/src/movepick.cpp
 3,214,026,252  movepick.cpp:MovePicker::next_move() [/home/l |  3,313,023,950  movepick.cpp:MovePicker::next_move() [/home/l
 2,235,801,714  search.cpp:Value (anonymous namespace)::qsear |  2,345,899,898  search.cpp:Value (anonymous namespace)::qsear
 2,215,234,258  search.cpp:Value (anonymous namespace)::qsear |  2,325,332,442  search.cpp:Value (anonymous namespace)::qsear
 1,890,006,027  /home/lila/fishnet/Stockfish/src/position.cpp |  2,075,694,511  /home/lila/fishnet/Stockfish/src/position.cpp
 1,857,018,603  /home/lila/fishnet/Stockfish/src/position.h:S |  1,978,628,635  /home/lila/fishnet/Stockfish/src/position.h:S
 1,420,088,153  position.cpp:Position::do_move(Move, StateInf |  1,606,303,356  position.cpp:Position::do_move(Move, StateInf
 1,403,087,215  /home/lila/fishnet/Stockfish/src/position.cpp |  1,541,865,342  /home/lila/fishnet/Stockfish/src/position.cpp
 1,039,362,837  position.cpp:Position::see_ge(Move, Value) co |  1,194,560,680  position.cpp:Position::see_ge(Move, Value) co
 1,028,670,253  evaluate.cpp:Score (anonymous namespace)::eva |  1,099,081,913  evaluate.cpp:Score (anonymous namespace)::eva
   698,359,488  position.cpp:Position::set_check_info(StateIn |    860,319,261  position.cpp:Position::set_check_info(StateIn
   554,323,098  /home/lila/fishnet/Stockfish/src/movegen.cpp: |    566,437,422  /home/lila/fishnet/Stockfish/src/movegen.cpp:
   539,180,193  movegen.cpp:ExtMove* generate<(GenType)0>(Pos |    551,294,517  movegen.cpp:ExtMove* generate<(GenType)0>(Pos
   508,174,158  /home/lila/fishnet/Stockfish/src/position.cpp |    510,501,523  /home/lila/fishnet/Stockfish/src/position.cpp
   470,740,759  pawns.h:Value Eval::evaluate<false>(Position  |    469,414,495  pawns.h:Value Eval::evaluate<false>(Position 
   400,707,071  types.h:Value Eval::evaluate<false>(Position  |    417,705,235  /home/lila/fishnet/Stockfish/src/position.cpp
   391,351,977  /home/lila/fishnet/Stockfish/src/position.cpp |    404,208,276  types.h:Value (anonymous namespace)::search<(
   388,975,638  types.h:Value (anonymous namespace)::search<( |    388,129,706  types.h:Value Eval::evaluate<false>(Position 
                                                              >    364,696,940  search.cpp:Value (anonymous namespace)::qsear
                                                              >    361,888,015  search.cpp:Value (anonymous namespace)::qsear
   348,601,201  /home/lila/fishnet/Stockfish/src/pawns.cpp:Pa      348,601,201  /home/lila/fishnet/Stockfish/src/pawns.cpp:Pa
   347,510,303  search.cpp:Value (anonymous namespace)::qsear |    332,939,118  types.h:MovePicker::next_move()
   344,701,378  search.cpp:Value (anonymous namespace)::qsear |    318,033,272  position.h:Score (anonymous namespace)::evalu
                                                              >    302,821,971  position.cpp:Position::slider_blockers(unsign
   286,678,984  /home/lila/fishnet/Stockfish/src/types.h:Posi      286,678,984  /home/lila/fishnet/Stockfish/src/types.h:Posi
   274,424,112  /home/lila/fishnet/Stockfish/src/position.h:P |    274,424,365  /home/lila/fishnet/Stockfish/src/position.h:P
   273,765,607  position.h:Score (anonymous namespace)::evalu <
   268,173,002  types.h:MovePicker::next_move()               <
   254,484,355  /home/lila/fishnet/Stockfish/src/tt.h:Transpo      254,484,355  /home/lila/fishnet/Stockfish/src/tt.h:Transpo
   244,932,812  /home/lila/fishnet/Stockfish/src/movegen.cpp: |    247,555,471  /home/lila/fishnet/Stockfish/src/movegen.cpp:
   244,153,930  movegen.cpp:ExtMove* (anonymous namespace)::g |    247,361,786  movegen.cpp:ExtMove* (anonymous namespace)::g
   238,721,072  pawns.cpp:Pawns::probe(Position const&) [/hom |    246,711,680  /home/lila/fishnet/Stockfish/src/position.cpp
   238,404,868  /home/lila/fishnet/Stockfish/src/position.cpp |    238,721,072  pawns.cpp:Pawns::probe(Position const&) [/hom
   237,583,235  /home/lila/fishnet/Stockfish/src/types.h:Posi |    237,587,164  /home/lila/fishnet/Stockfish/src/position.h:P
   231,781,071  bitboard.h:Score (anonymous namespace)::evalu |    237,370,744  bitboard.h:Score (anonymous namespace)::evalu
   229,485,444  movepick.h:MovePicker::next_move()            |    231,194,185  position.cpp:Position::legal(Move) const [/ho
   224,727,989  types.h:Score (anonymous namespace)::evaluate |    226,069,023  types.h:Score (anonymous namespace)::evaluate
   223,458,164  /home/lila/fishnet/Stockfish/src/types.h:Posi      223,458,164  /home/lila/fishnet/Stockfish/src/types.h:Posi
                                                              >    223,236,718  movegen.cpp:ExtMove* generate<(GenType)1>(Pos
   222,888,960  /home/lila/fishnet/Stockfish/src/position.h:P      222,888,960  /home/lila/fishnet/Stockfish/src/position.h:P
   222,662,625  tt.cpp:TranspositionTable::probe(unsigned lon      222,662,625  tt.cpp:TranspositionTable::probe(unsigned lon
   221,803,031  /home/lila/fishnet/Stockfish/src/pawns.cpp:Sc      221,803,031  /home/lila/fishnet/Stockfish/src/pawns.cpp:Sc
   221,360,877  types.h:Position::see_ge(Move, Value) const   |    219,185,412  movepick.cpp:void MovePicker::score<(GenType)
   220,614,059  movegen.cpp:ExtMove* generate<(GenType)1>(Pos |    216,103,882  movegen.cpp:ExtMove* (anonymous namespace)::g
   213,785,140  position.cpp:Position::undo_move(Move) [/home |    213,916,160  position.cpp:Position::undo_move(Move) [/home
   213,254,576  movegen.cpp:ExtMove* (anonymous namespace)::g |    211,876,496  types.h:Position::do_move(Move, StateInfo&, b
   211,631,064  types.h:Position::do_move(Move, StateInfo&, b |    211,862,059  movepick.h:MovePicker::next_move()
   210,262,336  pawns.cpp:Score Pawns::Entry::do_king_safety< |    210,262,336  pawns.cpp:Score Pawns::Entry::do_king_safety<
   206,849,746  movepick.cpp:void MovePicker::score<(GenType) |    200,704,071  types.h:Position::see_ge(Move, Value) const
   202,999,192  position.cpp:Position::legal(Move) const [/ho <
   191,653,835  position.h:Position::is_variant_end() const [ <
   191,653,835  /home/lila/fishnet/Stockfish/src/position.h:P <
   181,460,635  /home/lila/fishnet/Stockfish/src/pawns.cpp:Sc <

Callgrind annotation using --threshold=50 without/with -DANTI (complete):

-------------------------------------------------------------   -------------------------------------------------------------
Profile data file 'callgrind.out.18478' (creator: callgrind-3 | Profile data file 'callgrind.out.18832' (creator: callgrind-3
-------------------------------------------------------------   -------------------------------------------------------------
I1 cache:                                                       I1 cache: 
D1 cache:                                                       D1 cache: 
LL cache:                                                       LL cache: 
Timerange: Basic block 0 - 3067735945                         | Timerange: Basic block 0 - 3325791624
Trigger: Program termination                                    Trigger: Program termination
Profiled target:  ./stockfish_base bench (PID 18478, part 1)  | Profiled target:  ./stockfish bench (PID 18832, part 1)
Events recorded:  Ir                                            Events recorded:  Ir
Events shown:     Ir                                            Events shown:     Ir
Event sort order: Ir                                            Event sort order: Ir
Thresholds:       50                                            Thresholds:       50
Include dirs:                                                   Include dirs:     
User annotated:                                                 User annotated:   
Auto-annotation:  off                                           Auto-annotation:  off

-------------------------------------------------------------   -------------------------------------------------------------
            Ir                                                              Ir 
-------------------------------------------------------------   -------------------------------------------------------------
19,101,514,352  PROGRAM TOTALS                                | 20,222,342,852  PROGRAM TOTALS

-------------------------------------------------------------   -------------------------------------------------------------
           Ir  file:function                                               Ir  file:function
-------------------------------------------------------------   -------------------------------------------------------------
1,823,907,316  search.cpp:Value (anonymous namespace)::search | 2,047,873,044  search.cpp:Value (anonymous namespace)::search
1,467,929,891  movepick.cpp:MovePicker::next_move() [/home/li | 1,502,438,085  movepick.cpp:MovePicker::next_move() [/home/li
1,345,721,132  evaluate.cpp:Value Eval::evaluate<false>(Posit | 1,405,249,353  evaluate.cpp:Value Eval::evaluate<false>(Posit
1,028,670,253  evaluate.cpp:Score (anonymous namespace)::eval | 1,099,081,913  evaluate.cpp:Score (anonymous namespace)::eval
  819,019,917  position.cpp:Position::see_ge(Move, Value) con |   974,217,760  position.cpp:Position::see_ge(Move, Value) con
  677,130,431  position.cpp:Position::do_move(Move, StateInfo |   708,334,202  position.cpp:Position::do_move(Move, StateInfo
  400,707,071  types.h:Value Eval::evaluate<false>(Position c |   404,208,276  types.h:Value (anonymous namespace)::search<((
  388,975,638  types.h:Value (anonymous namespace)::search<(( |   388,129,706  types.h:Value Eval::evaluate<false>(Position c
  362,780,583  position.cpp:Position::set_check_info(StateInf |   332,939,118  types.h:MovePicker::next_move()
  273,765,607  position.h:Score (anonymous namespace)::evalua |   318,033,272  position.h:Score (anonymous namespace)::evalua
  268,173,002  types.h:MovePicker::next_move()                |   269,559,168  position.cpp:Position::set_check_info(StateInf
  238,721,072  pawns.cpp:Pawns::probe(Position const&) [/home |   238,721,072  pawns.cpp:Pawns::probe(Position const&) [/home
  231,781,071  bitboard.h:Score (anonymous namespace)::evalua |   237,370,744  bitboard.h:Score (anonymous namespace)::evalua
  229,485,444  movepick.h:MovePicker::next_move()             |   230,445,283  position.cpp:Position::legal(Move) const [/hom

My last couple commits both seem to be about a 1% speedup. Now for some more callgrind testing!

My last commit is on a new branch because it changes functionality. I will submit a test.
EDIT: Nevermind, cutechess-cli and/or fishtest currently do not support antichess.

Now removing -DANTI is only a 4% speedup (previously was a 6% speedup):

base =     630162 +/- 8076
test =     655207 +/- 10425
diff =      25045 +/- 7135
speedup = 0.039744

@ddugovic 3 day ago removing -DANTI on my pc I got speedup = 0.037466 (view my previous post). If I'm not wrong the 6% speedup is with only 1 measure.

Ah, you are correct. Allow me to rerun that 3-day-old test:

base =     626633 +/- 8032
test =     657890 +/- 11225
diff =      31257 +/- 12764
speedup = 0.049881

I am curious, what is the performance penalty when using make profile-build instead of make build? Perhaps there isn't a large performance penalty after all?

make profile-build is a 11% speedup

bash bench-parallel.sh ./stockfish ./stockfish-profile 10

run     base    test    diff
  1  1775428  1983423  +207995
  2  1711471  1924263  +212792
  3  1759121  1968137  +209016
  4  1698193  1879993  +181800
  5  1701021  1912852  +211831
  6  1700077  1878840  +178763
  7  1757607  1964352  +206745
  8  1790993  1998949  +207956
  9  1767747  1968137  +200390
 10  1782658  1978301  +195643

base =    1744431 +/- 24444
test =    1945724 +/- 28396
diff =     201293 +/- 7978
speedup = 0.115392

Ah, thanks... and now that I reread your initial comment (and understand the nuance of profile-build being used for official releases) there's still an issue.

I think this is fixed. What do you think?

$ bash bench-parallel.sh ./stockfish_base ./stockfish_test 10
run   1 / 10
run   2 / 10
run   3 / 10
run   4 / 10
run   5 / 10
run   6 / 10
run   7 / 10
run   8 / 10
run   9 / 10
run  10 / 10

run     base    test    diff
  1  695424  661569  -33855
  2  875414  741982  -133432
  3  686928  672679  -14249
  4  673122  624111  -49011
  5  682188  632876  -49312
  6  697959  622400  -75559
  7  624875  650475  +25600
  8  652483  638347  -14136
  9  646086  622147  -23939
 10  651997  625640  -26357

base =     688647 +/- 45592
test =     649222 +/- 24185
diff =     -39425 +/- 27783
speedup = -0.057250

PGO (profile-build):

$ bash bench-parallel.sh ./stockfish_base ./stockfish_test 10
run   1 / 10
run   2 / 10
run   3 / 10
run   4 / 10
run   5 / 10
run   6 / 10
run   7 / 10
run   8 / 10
run   9 / 10
run  10 / 10

run     base    test    diff
  1  727106  735394  +8288
  2  778356  868837  +90481
  3  838639  903949  +65310
  4  802826  884766  +81940
  5  697561  691813  -5748
  6  684015  652205  -31810
  7  704052  700111  -3941
  8  679089  653387  -25702
  9  649992  667550  +17558
 10  684168  671867  -12301

base =     724580 +/- 40211
test =     742987 +/- 66549
diff =      18407 +/- 29240
speedup = 0.025404

On my PC there is always a 13-14% slowdown respect to Official Stockfish

MSYS2 & MinGW-w64

$ bash bench-parallel.sh  ./stockfish-off.exe ./stockfish-mv.exe 10

run     base    test    diff
  1  2167177  1857768  -309409
  2  2191981  1860588  -331393
  3  2161826  1863417  -298409
  4  2181836  1858895  -322941
  5  2164881  1857768  -307113
  6  2174096  1848802  -325294
  7  2187287  1870240  -317047
  8  2182613  1831673  -350940
  9  2158020  1852714  -305306
 10  2190414  1861719  -328695

base =    2176013 +/- 8141
test =    1856358 +/- 6815
diff =    -319654 +/- 10138
speedup = -0.146899

LSW

~# bash bench-parallel.sh ./stockfish-off ./stockfish-mv 10
run     base    test    diff
  1  2264048  1963722  -300326
  2  2156502  1885198  -271304
  3  2171016  1897454  -273562
  4  2122153  1865118  -257035
  5  2163352  1877114  -286238
  6  2247443  1963093  -284350
  7  2197482  1888101  -309381
  8  2263212  1949977  -313235
  9  2205390  1916441  -288949
 10  2146682  1848244  -298438

base =    2193728 +/- 33005
test =    1905446 +/- 26936
diff =    -288281 +/- 11559
speedup = -0.131412

Ah, you are correct. Sorry after much effort debugging I'd been so focused on "all variants plus/minus antichess" that I'd forgotten the original issue.

Another benchmark test (no variant flags in Makefile versus all variant flags in Makefile):

$ bash bench-parallel.sh ./stockfish-base ./stockfish 10
run   1 / 10
run   2 / 10
run   3 / 10
run   4 / 10
run   5 / 10
run   6 / 10
run   7 / 10
run   8 / 10
run   9 / 10
run  10 / 10

run     base    test    diff
  1  1324023  1169922  -154101
  2  1398909  1241048  -157861
  3  1417876  1231815  -186061
  4  1434597  1258605  -175992
  5  1434597  1261535  -173062
  6  1407830  1243637  -164193
  7  1255159  1116873  -138286
  8  1214250  1083970  -130280
  9  1425676  1263139  -162537
 10  1430466  1262871  -167595

base =    1374338 +/- 52912
test =    1213341 +/- 43150
diff =    -160996 +/- 11043
speedup = -0.117145

Today I ran another test:

run     base    test    diff
  1  1517140  1358765  -158375
  2  1473646  1320027  -153619
  3  1501368  1330159  -171209
  4  1512223  1363346  -148877
  5  1514110  1364573  -149537
  6  1308918  1185367  -123551
  7  1488473  1329868  -158605
  8  1488107  1321753  -166354
  9  1512600  1349394  -163206
 10  1519420  1360593  -158827

base =    1483600 +/- 41304
test =    1328384 +/- 34780
diff =    -155216 +/- 8590
speedup = -0.104621
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ppigazzini picture ppigazzini  Â·  8Comments

ddugovic picture ddugovic  Â·  10Comments

ppigazzini picture ppigazzini  Â·  14Comments

ianfab picture ianfab  Â·  6Comments

isaacl picture isaacl  Â·  9Comments