I compiled StockFish with MinGW and it's faster...

Discussion of chess software programming and technical issues.

Moderator: Ras

OneTrickPony
Posts: 160
Joined: Tue Apr 30, 2013 1:29 am

I compiled StockFish with MinGW and it's faster...

Post by OneTrickPony »

... than official release.
At least it seems to be faster. I run go depth 20 and it takes 4914ms on my machine (one thread) while official release takes 5011ms.
I just used -O3 -DNDEBUG -march=native flags.
Any ideas why that could be ?

(the CPU is i7-3770)
Last edited by OneTrickPony on Fri Sep 27, 2013 2:21 am, edited 1 time in total.
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: I compiled StockFish with MinGW and it's faster...

Post by syzygy »

OneTrickPony wrote:Any ideas why that could be ?
Apparently you have compiled it with a different compiler and/or different flags. If you have two different compiles, one will usually be faster, the other slower...
OneTrickPony
Posts: 160
Joined: Tue Apr 30, 2013 1:29 am

Re: I compiled StockFish with MinGW and it's faster...

Post by OneTrickPony »

What I mean is that my compilation is faster than prebuilded .exe available from official website (and I didn't use any advanced flags nor PGO yet and MinGW is supposed to be slower than Intel on Windows whcih I think is used for official builds)
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: I compiled StockFish with MinGW and it's faster...

Post by syzygy »

OneTrickPony wrote:What I mean is that my compilation is faster than prebuilded .exe available from official website
Yes, it was pretty hard to miss that. But you also asked a question, and I answered it.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: I compiled StockFish with MinGW and it's faster...

Post by kbhearn »

as far as i'm aware 'official builds' are pulled from the abrok.eu/stockfish site now, which is also MinGW for the windows builds. As to why yours is faster, one or more of:

- not the same version of the code
- not the same version of the compiler
- compiler is making optimisation decisions based on your machine
OneTrickPony
Posts: 160
Joined: Tue Apr 30, 2013 1:29 am

Re: I compiled StockFish with MinGW and it's faster...

Post by OneTrickPony »

Ok I thought official builds are optimized (compiled with the best best options/compiler and/or using PGO).
I also noticed that this page http://abrok.eu/stockfish/comment says that GCC 4.7.3 is used. From my experience on Windows gcc 4.8 is much faster so maybe that explains it.
Out of curiosity what version is shipped for rating lists testing ? I mean, compiling with different version of MinGW sometimes means very significant performance difference (I remember some older version produced much slower code for my poker computing library than both visual studio and Intel and 4.8 produces 10-15% faster code than visual studio on most trivial of programs).
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: I compiled StockFish with MinGW and it's faster...

Post by syzygy »

OneTrickPony wrote:Ok I thought official builds are optimized (compiled with the best best options/compiler and/or using PGO).
There is no single combination of options/compiler that is best for all machines.
I also noticed that this page http://abrok.eu/stockfish/comment says that GCC 4.7.3 is used. From my experience on Windows gcc 4.8 is much faster so maybe that explains it.
In my experience gcc-4.8.x produces measurably slower code than gcc-4.7.3. It seems gcc-4.8.x has some optimisation bugs (which also lead to bogus warnings that gcc-4.7 did not emit).
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: I compiled StockFish with MinGW and it's faster...

Post by mcostalba »

OneTrickPony wrote:Ok I thought official builds are optimized (compiled with the best best options/compiler and/or using PGO).
I also noticed that this page http://abrok.eu/stockfish/comment says that GCC 4.7.3 is used. From my experience on Windows gcc 4.8 is much faster so maybe that explains it.
Out of curiosity what version is shipped for rating lists testing ? I mean, compiling with different version of MinGW sometimes means very significant performance difference (I remember some older version produced much slower code for my poker computing library than both visual studio and Intel and 4.8 produces 10-15% faster code than visual studio on most trivial of programs).
Could you please post a link to download your Windows compile of current master ?

I'd like to compare it with abrok.eu. Thanks.
OneTrickPony
Posts: 160
Joined: Tue Apr 30, 2013 1:29 am

Re: I compiled StockFish with MinGW and it's faster...

Post by OneTrickPony »

Hi,

So it turned out the code in master repo wasn't the same as the one used to build official build at the time I downloaded them. I recompiled sources shipped with the official build and I couldn't get comparable performance (my compile is now 4-5% slower at both bench() and go depth 24).
Sorry for the fuss.