The Build tab of the Project Properties in Visual Studio 2005/2008 contains the "Optimize code".
The documentation states that it "... enables or disables optimizations performed by the compiler to make your output file smaller, faster, and more efficient."
The Optimize option enables or disables optimizations performed by the compiler to make your output file smaller, faster, and more efficient.
First of all, what is code optimization? Often, when we define it, we assume that we want code to perform better. We say that code optimization is writing or rewriting code so a program uses the least possible memory or disk space, minimizes its CPU time or network bandwidth, or makes the best use of additional cores.
Optimize Program Algorithm For any code, you should always allocate some time to think the right algorithm to use. So, the first task is to select and improve the algorithm which will be frequently used in the code. 2. Avoid Type Conversion Whenever possible, plan to use the same type of variables for processing.
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)
It is not on by default for DEBUG builds for the above reason, it should be enabled by default on release builds
It performs optimizations such as dynamic inlining and removing unneeded local variables. Any sort of optimization that can be decided upon at compile time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With