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.)
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.
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.
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.
A Debug configuration supports the debugging of an app, and a Release configuration builds a version of the app that can be deployed.
Off the top of my head, I can think of a couple of reasons:
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.)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With