开发者

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

开发者 https://www.devze.com 2022-12-22 21:13 出处:网络
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 res

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!


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.


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


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.


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++.

0

精彩评论

暂无评论...
验证码 换一张
取 消