0

I wanted to know the optimum performance configuration I can obtain for a release build. I do not need any debugging info in a release build and if omitting it helps boost performance in a release build I am more than happy to abide by those changes. Kindly let me know if these setting are acceptable or if any of these settings should be changed for better performance.This is the configuration I have

Build Type : Release

Debug Information Format : Program Database (/Zi)

Preprocesors : Following are the preprocessors

WIN32 QT_LARGEFILE_SUPPORT QT_DLL QT_NO_DEBUG NDEBUG QT_CORE_LIB QT_GUI_LIB

Generate Debug Info : Yes (/Debug)

Optimization : Maximize Speed (/O2)

Whole Program Optimization : No

Overview of entire configuration

/I".\GeneratedFiles" /I"." /I"C:\Qt\4.8.4\include" /I".\GeneratedFiles\Release" /I"C:\Qt\4.8.4\include\QtCore" /I"C:\Qt\4.8.4\include\QtGui" /I"....\External\boost-win-1.47-32bit-vs2010\include\boost-1_47" /I"....\External\ta-lib-0.4.0-msvc\ta-lib\c\include\" /I"....\External\Qpid-32Bit\Debug\include\" /I"..\Common\" /I"....\External\log4cplus-1.1.2-rc1\include" /Zi /nologo /W1 /WX- /O2 /Oy- /D "WIN32" /D "QT_LARGEFILE_SUPPORT" /D "QT_DLL" /D "QT_NO_DEBUG" /D "NDEBUG" /D "QT_CORE_LIB" /D "QT_GUI_LIB" /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t- /Zc:forScope /Fp"Release\WOPR.pch" /Fa"Release\" /Fo"Release\" /Fd"Release\vc100.pdb" /Gd /analyze- /errorReport:queue

Should any of the above options be changed inorder to obtain maximum runtime performance. If I have omitted any options kindly let me know.

4

1 回答 1

1

如果您想从编译器中获得最优化的代码,您可以尝试对关键代码进行配置文件引导优化。然而,这种优化并不像简单地调整编译器选项那么容易实现。

要实现这一点,您将需要一套代表现实生活场景的测试。检测您的代码,运行这些测试,然后:

  • 检测数据将告诉您大部分 CPU 时间花在哪里。尝试(手动)优化代码中似乎占用大量 CPU 的部分。
  • 使用检测数据作为输入再次编译您的关键代码。

我从未在 Visual Studio 中使用过它(仅限英特尔编译器)。VS2010似乎有profile-guide优化功能

于 2013-06-20T08:40:49.750 回答