Clang has link-time optimization (with option -flto), but not profile-guided optimization (pgo).
Below are some comparisons with gcc for building and benchmarking Stockfish, in which clang comes out well.
gcc, no pgo
Code: Select all
$ time make ARCH=x86-64-modern
real 0m16.551s
user 0m14.981s
sys 0m1.218s
$ stockfish bench 32 1 15 default depth > /dev/null
Total time (ms) : 27595
Nodes searched : 34823328
Nodes/second : 1261943
Code: Select all
$ time make popcnt-profile-build ARCH=x86-64-modern
real 0m59.756s
user 0m55.749s
sys 0m3.657s
$ stockfish bench 32 1 15 default depth > /dev/null
Total time (ms) : 26887
Nodes searched : 34823328
Nodes/second : 1295173
Code: Select all
$ time make ARCH=x86-64-modern COMP=clang
real 0m13.593s
user 0m12.215s
sys 0m0.780s
$ stockfish bench 32 1 15 default depth > /dev/null
Total time (ms) : 25910
Nodes searched : 34823328
Nodes/second : 1344011