Enables or disables compiler optimizations.
- + | -
-
Optional. The /optimize- option disables compiler optimizations. The /optimize+ option enables optimizations. By default, optimizations are disabled.
Compiler optimizations make your output file smaller, faster, and more efficient. However, because optimizations result in code rearrangement in the output file, /optimize+ can make debugging difficult.
All modules generated with /target:module for an assembly must use the same /optimize settings as the assembly. For more information, see /target (Visual Basic).
You can combine the /optimize and /debug options.
To set /optimize in the Visual Studio integrated development environment
-
Have a project selected in Solution Explorer. On the Project menu, click Properties.
For more information, see Introduction to the Project Designer.
-
Click the Compile tab.
-
Click the Advanced button.
-
Modify the Enable optimizations check box.
The following code compiles T2.vb and enables compiler optimizations.
Reference
/debug (Visual Basic)
Sample Compilation Command Lines
/target (Visual Basic)
Other Resources
Visual Basic Compiler