Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is /Gm the default option in debug configuration as opposed to /MP?

After I disabled /Gm and enabled /MP, the build time on VS2010 is reduced significantly.

I am confused as to why /Gm is the default. I think /MP is better.

(If /Gm is enabled, /MP is not activated because of incompatibility. Activated /Gm takes more time than Activated /MP.)

like image 703
codevania Avatar asked Jan 03 '11 05:01

codevania


People also ask

What is the difference between debug mode and Release mode in Visual Studio?

Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.

What is difference between Release and debug mode?

By default, Debug includes debug information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. As far as conditional compilation goes, they each define different symbols that can be checked in your program, but they are language-specific macros.

How do I set debug configuration in Visual Studio?

You can change C# project debug settings in the Debug tab and Build tab of the project property pages. To open the property pages, select the project in Solution Explorer and then select the Properties icon, or right-click the project and select Properties. For more information, see Debug and release configurations.

What are debug and Release build configurations?

A Debug configuration supports the debugging of an app, and a Release configuration builds a version of the app that can be deployed.


1 Answers

Off the top of my head, I can think of a couple of reasons:

  1. The improvement in build time with the /MP option depends upon the number of processors the user has available. The Visual Studio team probably doesn't think it's reasonable (yet) to assume that everyone has multiple processors. (Note that HyperThreading doesn't necessarily count as multiple processors when it comes to optimizations like this one.)

  2. The /MP option is incompatible with some compiler options and language features. Generally, defaults should try to maximize compatibility, even at the expense of speed if necessary. That something is "better" is not the only criteria evaluated when choosing to make it a default setting. You shouldn't have to crack open the manual to see what the "D9030" or "C2813" compiler warnings mean and why your project that compiled just fine on VS2008 won't compile on VS2010.

The documentation explains these concerns in more detail, and even include some Guidelines on how to determine if enabling the /MP option is the best decision for individual cases.

Any time that you find yourself having to publish guidelines on whether or not a feature should be enabled, it probably shouldn't be enabled by default. Advanced users (and no, this is not an oxymoron: not everyone that uses Visual Studio is an advanced user because this designation is relative to the product in question) like you can decide for themselves whether or not they want to enable this option.

like image 149
Cody Gray Avatar answered Oct 19 '22 10:10

Cody Gray