Page 2 of 2

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 12:26 pm
by Houdini
rvida wrote:
vladstamate wrote: I can testify to that. I got roughly 12% increase in speed (both when doing perft as well as normal search) by using PGO. In Visual Studio that is done as simply as clicking 3 buttons and waiting your program to run for some time so it gets some performance data. I was quite impressed.
You are a lucky one. Or you just happen to write "branchy" code. In my experience with Critter there is only cca 5% speedup from PGO :(
PGO improvements depend very much on the code.
On my current code PGO provokes a 2% slow-down compared to the normal /O2 /GL compile. PGO doesn't seem to achieve a lot apart from inflating the exe from 233 kB to 277 kB :(.

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 4:38 pm
by vladstamate
Dann Corbit wrote: I have seen up to 30% for some engines.
I usually do the following sort of test during the profile sessions:
1. A couple hundred EPD test positions at 5 seconds each
2. At least ten games of engine verses engine.
3. Perft (if the engine has it) at depths 4/5/6
On the games, I have the GUI restart the engines after each game.
Is the pgo data produced by running the instrumented executable incremental? That is when you run it each time does it add to the same file or replace?

Also has anyone tried (successfully) pgo on gcc?

Regards,
Vlad

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 8:10 pm
by silentshark
Dann Corbit wrote:
silentshark wrote:The subject field says it all, really. What are good compiler flags to wring out good speed from the MS C++ 2008 compiler?

So far, I've found the following are good:

/O2 - optimise speed
/arch:SSE2 - compile for platforms supporting SSE2 instruction set

But there are probably some other ones I haven't come across?

(And feel free to tell me to go and use compiler X, if I really should be trying something else for high speed code these days)

Regards,
Tom
The Intel compiler produces a little bit better results, most of the time.
Profile guided optimization produced a good gain almost all the time (for both Intel and MSVC++ compilers).
I will give pgo a go, although it looks like a need a better version of the dev. environment.. vc++ 2008 express appears to lack the pgo stuff :(

Is the Intel compiler a freebie?

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 8:22 pm
by tmokonen
The Intel compiler is not free, but you can download a trial version if you want to play with the compiler.

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 8:44 pm
by Dann Corbit
vladstamate wrote:
Dann Corbit wrote: I have seen up to 30% for some engines.
I usually do the following sort of test during the profile sessions:
1. A couple hundred EPD test positions at 5 seconds each
2. At least ten games of engine verses engine.
3. Perft (if the engine has it) at depths 4/5/6
On the games, I have the GUI restart the engines after each game.
Is the pgo data produced by running the instrumented executable incremental? That is when you run it each time does it add to the same file or replace?

Also has anyone tried (successfully) pgo on gcc?

Regards,
Vlad
With MSVC++, each new pgo profile run creates a new file. When you perform the link, all the files get merged.

PGO works well with gcc also. However, my 64 bit GCC installation is flaky now and I have not been able to repair it.

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Tue Apr 13, 2010 8:45 pm
by Dann Corbit
tmokonen wrote:The Intel compiler is not free, but you can download a trial version if you want to play with the compiler.
The Intel compiler is free for non-commercial use on Linux.

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Wed Apr 14, 2010 10:12 pm
by silentshark
silentshark wrote:
Dann Corbit wrote:
silentshark wrote:The subject field says it all, really. What are good compiler flags to wring out good speed from the MS C++ 2008 compiler?

So far, I've found the following are good:

/O2 - optimise speed
/arch:SSE2 - compile for platforms supporting SSE2 instruction set

But there are probably some other ones I haven't come across?

(And feel free to tell me to go and use compiler X, if I really should be trying something else for high speed code these days)

Regards,
Tom
The Intel compiler produces a little bit better results, most of the time.
Profile guided optimization produced a good gain almost all the time (for both Intel and MSVC++ compilers).
I will give pgo a go, although it looks like a need a better version of the dev. environment.. vc++ 2008 express appears to lack the pgo stuff :(

Is the Intel compiler a freebie?
cool.. the pgo stuff in vc++ 2010 seems to give me about a 15% performance boost. Worth having..

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Mon Apr 19, 2010 12:00 am
by Cardoso
My checkers engine is totaly dependent on the GUI for commands.
After I launch the GUI and it loads the engine is it possible to atach VS2008 to the engine process and execute the PGO?

Thanks,
Alvaro

Re: Visual C++ 2008 - good compiler/ linker settings for spe

Posted: Mon Apr 19, 2010 2:15 am
by Greg Strong
Actually, you just build a PGO-instrumented build of your checkers engine and use that. Each time the program runs, it automatically outputs a file with the technical timing/performance data. You can then use this data to build a PGO optimized version. Visual studio doesn't itself need to be running for the profiling session.

Many thanks (NT)

Posted: Tue Apr 20, 2010 3:22 pm
by Cardoso
Many thanks,
Alvaro