the difference compiling engines using different progs?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: the difference compiling engines using different progs?

Post by jshriver »

This may not be accurate but my general view after years playing with different compilers:

Linux and Windows x86 (Intel or AMD) Intels icc seems to produce the quickest code. Though I hear it's favors Intel even more so than AMD, but still better than gcc.

Mac: gcc only because I dont know of any other compilers for the system, and Apple has refined it's PPC/x86 fork of gcc nicely it seems.

For general use I pretty much stick to gcc for everything. Good, quick, and I love gdb and gprof (for profiling). If I was to compile my code for a tournament I'd be tempted to use icc just to get every ounce possible.

Overall I'm more concerned with the quality of my code. You can probably refine your code to give a lot better results than just switching compilers. imho the compiler is just for the extra umph.

Just my $0.02.
micron
Posts: 155
Joined: Mon Feb 15, 2010 9:33 am
Location: New Zealand

Re: the difference compiling engines using different progs?

Post by micron »

These results obtained for my program on a Mac may be of interest.

Code: Select all

Nominal 9 ply search from the start position
gcc 4.0 -O3   7.05 s
gcc 4.2 -O3   6.92 s
clang   -O3   6.48 s
clang   -O4   5.95 s
The -O4 option for clang http://clang.llvm.org/ enables link-time optimization.
Robert P.
PawnStormZ
Posts: 880
Joined: Mon Feb 15, 2010 6:43 am

Re: the difference compiling engines using different progs?

Post by PawnStormZ »

micron wrote:These results obtained for my program on a Mac may be of interest.

Code: Select all

Nominal 9 ply search from the start position
gcc 4.0 -O3   7.05 s
gcc 4.2 -O3   6.92 s
clang   -O3   6.48 s
clang   -O4   5.95 s
The -O4 option for clang http://clang.llvm.org/ enables link-time optimization.
Robert P.
Thanks Robert.  A 16% speedup from worst to best is nothing to ignore!

    I wonder if there are enough different compiles of the same source-code of the publicly available engines to make collecting and testing them a worthwhile little project.

    Knowing that compiler X could give me a 16% faster performance while analyzing would be valuable when deciding which engine files to download.