Enables or disables compiler optimizations.
/optimize[ + | - ]
- + | -
- /optimize- disables compiler optimizations. /optimize+ 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 used by an assembly must have been built using the same /optimize settings as the assembly's /optimize setting.
You can combine the /optimize and /debug options.
To set /baseaddress in the Visual Studio integrated development environment
- Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
- Click the Configuration Properties folder.
- Click the Optimizations property page.
- Modify the Enable optimizations property.
To set /optimize programmatically
- See Optimize Property.
The following code compiles
t2.vb and enables compiler optimizations:
vbc t2.vb /optimize