By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

Optimize option

P: n/a
Hi there,

I recently came across an interesting option when right clicking on a
project (Right click on the project -> properties -> Configuration
Properties ->Build -> Optimize)

There is an option in there to optimize the code, has anyone had any
expeiance / problems with this option and were there any significant gains
in performance by turning on this setting?

Below are some extracts from the help files on the setting.

Cheers,
Daniel
Optimize code
Enable or disable optimizations performed by the compiler to make your
output file smaller, faster, and more efficient. See /optimize for more
information.
See Optimize Property for information on how to programmatically access this
property.
Remarks
The /optimize option enables or disables optimizations performed by the
compiler to make your output file smaller, faster, and more efficient.
/optimize also tells the common language runtime to optimize code at
runtime.
By default, /optimize- is in effect. Specify /optimize+ to enable
optimizations.
When building a module to be used by an assembly, use the same /optimize
settings as those of the assembly.
/o is the short form of /optimize.
It is possible to combine the /optimize and /debug options.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Setting
Visual C# Project Properties.
Click the Configuration Properties folder.
Click the Build property page.
Modify the Optimize code property.
To set this compiler option programmatically
See Optimize Property.
Example
Compile t2.cs and enable compiler optimizations:
csc t2.cs /optimize
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.