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
Visual C++ 2008 - good compiler/ linker settings for speed?
Moderators: hgm, Rebel, chrisw
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
-
- Posts: 295
- Joined: Wed Mar 08, 2006 8:29 pm
Re: Visual C++ 2008 - good compiler/ linker settings for spe
You might want to add /GL
Roman
Roman
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
Re: Visual C++ 2008 - good compiler/ linker settings for spe
Ok, will do. Any other candidates? I've done some googling, but not found much - there's something about profile guided optimisation which I might have a gander at.Roman Hartmann wrote:You might want to add /GL
Roman
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Visual C++ 2008 - good compiler/ linker settings for spe
The Intel compiler produces a little bit better results, most of the time.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
Profile guided optimization produced a good gain almost all the time (for both Intel and MSVC++ compilers).
-
- Posts: 161
- Joined: Thu Jan 08, 2009 9:06 pm
- Location: San Francisco, USA
Re: Visual C++ 2008 - good compiler/ linker settings for spe
Hi,
Is that valid for AMD processors as well? Will it know to use some intrinsics like popcnt for example? I use then with the MSVC++ compiler.Dann Corbit wrote: The Intel compiler produces a little bit better results, most of the time.
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.Dann Corbit wrote:Profile guided optimization produced a good gain almost all the time (for both Intel and MSVC++ compilers).
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Visual C++ 2008 - good compiler/ linker settings for spe
There are problems using the Intel toolset for AMD processors.vladstamate wrote:Hi,
Is that valid for AMD processors as well? Will it know to use some intrinsics like popcnt for example? I use then with the MSVC++ compiler.Dann Corbit wrote: The Intel compiler produces a little bit better results, most of the time.
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.Dann Corbit wrote:Profile guided optimization produced a good gain almost all the time (for both Intel and MSVC++ compilers).
The most annoying of which is that the profiler castrates itself.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Visual C++ 2008 - good compiler/ linker settings for spe
/EH- /GR-silentshark wrote:Ok, will do. Any other candidates? I've done some googling, but not found much - there's something about profile guided optimisation which I might have a gander at.Roman Hartmann wrote:You might want to add /GL
Roman
Sven
-
- Posts: 481
- Joined: Thu Apr 16, 2009 12:00 pm
- Location: Slovakia, EU
Re: Visual C++ 2008 - good compiler/ linker settings for spe
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 PGOvladstamate 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.
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Visual C++ 2008 - good compiler/ linker settings for spe
I have seen up to 30% for some engines.rvida wrote: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 PGOvladstamate 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.
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.
-
- Posts: 660
- Joined: Sat Dec 05, 2009 5:13 am
- Location: Colorado, USA
Re: Visual C++ 2008 - good compiler/ linker settings for spe
I suppose he could be an unlucky one and his non-PGO code is just slow....rvida wrote: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 PGOvladstamate 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.
Peter