C# Compiler Optimizations

Problem
You want to make debugging easier and your code faster.

Solution
First, disable compiler optimization. Next, enable arithmetic overflow checks in Debug mode, but disable them in Release mode.

Comments
When compiler optimization is enabled, it can be difficult to follow execution flow in the debugger. Enabling arithmetic overflow checks in Debug mode can help you fix programming errors while disabling it in Release mode can make your code run substantially faster. Find the compiler optimization option in the IDE under Project Properties | Build | Optimize Code. Or, at the command prompt, use the /optimize- option. To enable/disable arithmetic overflow checks, right-click your project, select Properties, choose the Build page and click the Advanced button.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s