SharpAffair
SharpAffair

Reputation: 5488

Visual C++ 9 compiler options to make the program run faster

I have built an open-source application from the source code. Unfortunately, the original executable runs significantly faster. I tried to enable few compiler optimizations, but the result wasn't satisfactory enough. What else do I need to make in Visual Studio 2008 to increase the executable performance?

Thanks!

Upvotes: 2

Views: 1288

Answers (4)

AshleysBrain
AshleysBrain

Reputation: 22641

Basically try enabling everything under Optimisation in project settings, then ensure Link Time Code Generation is on, enable Function-level linking and full COMDAT folding (that only reduces the size of the EXE but could help with caching), and turn off security features such as by defining _SECURE_SCL=0. Remember some of these settings have other implications, especially the security ones.

Upvotes: 4

Rickard von Essen
Rickard von Essen

Reputation: 4298

The open-source precompiled binary is most likely (whit out know which project you are working with) compiled with GNU GCC (Mingw on Windows). That might be the reason that it is faster. According to question: performance g++ vs. VC++ some things are considerably slower if you use VC++.

Upvotes: 0

Henrik
Henrik

Reputation: 23324

Define _SECURE_SCL=0. http://msdn.microsoft.com/en-us/library/aa985896(VS.80).aspx

Upvotes: 4

0xDEAD BEEF
0xDEAD BEEF

Reputation: 2104

Try to enable SSE instructions, when compiling. Also - you can try to compile using different compiler (GNU GCC). +There might be enabled some debug defines, shich also can reduce speed. +Check, that original .exe has same version as one you are trying to compile.

Upvotes: 1

Related Questions