Skip to content

Conversation

@vondele
Copy link
Member

@vondele vondele commented Feb 26, 2017

about 0.5% speedup.

No functional change.

about 0.5% speedup.

No functional change.
@vondele
Copy link
Member Author

vondele commented Feb 26, 2017

Not sure this is worth it..

@Stefano80
Copy link
Contributor

If you're not sure, test it with SPRT[0, 5] (as indicated in the guidelines, btw)

@mcostalba
Copy link
Contributor

@vondele I would be surprised if speed up is confirmed, cmh, fmh, and fmh2 are loop invariant values so they should be optimized in the compiler or even in the CPU's branch prediction.

OTH I don't see any readability improvement here.

@vondele
Copy link
Member Author

vondele commented Feb 27, 2017

@mcostalba the hoisting of the loop invariant loads is happening, but the loop unswitching (for three conditionals) is not... at least with my setup. Would be good if speedup could be measured independently.

I agree that it isn't a readability improvement, just an (eventual) speedup.

@CoffeeOne
Copy link

CoffeeOne commented Feb 27, 2017

I confirm speed on my main PC: build with GCC 6.3.0 Profile Build, lto under Windows
Version1 is current Master
Version2 is this patch.
each 100 runs of bench 16 1 15 => 0.93% speedup

Build Tester: 1.4.6.0
Windows 10 (Version 10.0, Build 0, 64-bit Edition)
AMD FX(tm)-9590 Eight-Core Processor
SafeMode: No
Running In VM: No
HyperThreading Enabled: Yes
CPU Warmup: Yes
Command Line: bench 16 1 15 default depth
Tests per Build: 100
ANOVA: n/a

            Engine# (NPS)                     Speedup     Sp     Conf. 95%    S.S.

2 (1.705.211,1 ) ---> 1 (1.689.433,4 ) ---> 0,934% 23.800,6 Yes No

@MichaelB7
Copy link
Contributor

slower here , macOS, gcc4.8, PGO build, concurrent runs

bench 16 1 24
head
Total time (ms) : 266287
Nodes searched  : 466008793
Nodes/second    : 1750024

base
Total time (ms) : 268072
Nodes searched  : 466008793
Nodes/second    : 1738371

@vondele
Copy link
Member Author

vondele commented Mar 2, 2017

#1021 is the better approach and renders this patch unnecessary. Closing.

@vondele vondele closed this Mar 2, 2017
MichaelB7 pushed a commit to MichaelB7/Stockfish that referenced this pull request Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants