The “Optimize code” checkbox in Visual Studio. What exactly does it do?

后端 未结 3 1511
青春惊慌失措
青春惊慌失措 2021-02-07 03:27

The Build tab of the Project Properties in Visual Studio 2005/2008 contains the \"Optimize code\".

The documentation states that it \"... enables or disables optimizatio

3条回答
  •  失恋的感觉
    2021-02-07 04:16

    1. You wouldn't want this on for a debug built, as it makes stepping through code harder as the actual code that is running may not properly reflect what you have written (since some lines will be optimized out)

    2. It is not on by default for DEBUG builds for the above reason, it should be enabled by default on release builds

    3. It performs optimizations such as dynamic inlining and removing unneeded local variables. Any sort of optimization that can be decided upon at compile time.

提交回复
热议问题