Visual Studio - Build process optimized for multi processors
Posted by Just little ol' me at Monday, May 26, 2008
These days, everyone wants to buy state of the art technology when it comes to PCs. Fast processors, lots of RAM, stunning graphics cards, huge hard disk drives, blue ray drives, anything new on the market.
If you are a developer using Visual Studio 2005, you probably want to know how can you truly benefit from all the new hardware while programming your applications.
Well, I am happy to announce (for those of you who did not find out about this until now) that Microsoft has been asking this question for quite a while. When it comes to the RAM usage of Visual Studio, most of you already know that VS 2005 consumes more than VS 2003, but VS 2008 takes it to another level... Especially if you are a Vista user:
VS Version | Minimum RAM | Recommended RAM |
2005 | 192 | 256 |
2008 | 384 | 384+ XP 768+ |
Having 2GB + of RAM is nothing our days. Tomorrow, we will probably count RAM using Terra Bytes.
One great thing that Visual Studio 2008 brings for us, developers, is not only compatibility, but also optimization of the build process on multi core processor systems. This basically means more cores = faster build! And that, I must say, is COOL! Imagine using dual Quad processor system for building projects that usually take up to 10 hours to build. That reduces the overall build time to about 12%!!! Nice.
What is NOT nice nor COOL is that this feature was present also with Visual Studio 2005, just nobody informed us! And it so easy to enable it...
The /MP option can reduce the total time to compile the source files on the command line. The /MP option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.
So, just open Visual Studio, open up your C++ project (sorry C# users) -> right-click and select Properties -> in the left tree expand Configuration Properties -> expand C/C++ -> select Command Line. In the Additional options text area, type "/MP" and press OK. That's it, you're all set!
PS: I don't know if you need to restart VS or reboot your computer. It should not, since you are only modifying the command line arguments of the build command. Anyway, if you don't see any results after doing this change, you either did something wrong or need a new processor :P
Labels: microsoft , multithreading , Visual Studio