Game Development Community

VS2008 Multiple process compiles (ROCK!)

by Josh Engebretson · in General Discussion · 06/12/2008 (10:20 am) · 13 replies

I was digging around in VS2008's compiler switches and came across:

/MP (Build with Multiple Processes)

This looked interesting... The IDE defaults to using one process to compile your projects. So, I kicked off a rebuild of TGEA 1.7 using the default: 4 minutes 7 seconds

I then set the /MP compiler option to use 8 processes on the compile and did a rebuild: 1 minute 20 seconds

This is on a QX9770 which is a pretty fast processor to start with... but still, a 400% increase in compile speed from using a compiler switch is smiley inducing!

:)

#1
06/12/2008 (10:22 am)
Nice find to be sure
#2
06/12/2008 (11:38 am)
Josh, is this available in express editions as well? I may not be doing it right but it's not seeming to let me.. have any steps on how to do it you could share with me? :)
#3
06/12/2008 (11:59 am)
Yup, it works with VS 2008 Express

Right click on project and select properties then navigate to Configuration Properties -> C/C++ -> Command Line. In the "Additional options" text entry control add:

/MP3

This will compile the project with 4 processes. You can verify this by opening up Task Manager and looking for cl.exe instance whilst compiling project. It is a per-project setting, so make sure you set it for all projects. If you're using a quad core processor, you might want to try /MP7 :)
#4
06/12/2008 (1:43 pm)
Yep, this has been one of the major feature points for 2008 for a while, and a good reason to upgrade if you've got multi-core development PCs.
#5
06/12/2008 (2:00 pm)
You would think a major feature point would have a gui control assigned to it. I would have noticed that and not been using VS2008 for weeks before spotting the compiler switch ;)
#6
06/12/2008 (2:01 pm)
This is a neet-o trick. Thank you for sharing!
#7
06/12/2008 (2:18 pm)
@Josh, no doubt :P I expected it to be defaulted to on, honestly.
#8
06/12/2008 (2:44 pm)
This works in VS2005 as well, but it was never documented and sometimes the compiler barks.
#9
06/12/2008 (2:47 pm)
@Stefan, from what I understand, they're not exactly the same. 2005 I believe can only separate different projects between processes or some such, while 2008 does files within a project. I may be wrong though.
#10
06/13/2008 (11:09 am)
That's not the same feature Ross. The /MP compiler switch was added in a SP release I believe, but was never documented.

If you got a dual core CPU you'll see two cl.exe instances start, not one like before. Oh and it doesn't seem to work on debug builds.
#11
06/13/2008 (11:27 am)
@Stefan, ah cool, thanks for the clarification.
#12
06/13/2008 (11:28 am)
It works in debug and release on VS2008. Also, the switch takes arguments for number of processes in VS2008 (not sure about VS2005). There are some incompatible settings which will automatically disable it. However, TGEA 1.7 solution works fine.
#13
06/13/2008 (9:57 pm)
Excellent! Thanks so much. Yes. This worked in VS 2005. Like Ross mentioned, I always thought VS 2005 just did it based on project dependencies. I think by default, that's what it does. But I tried the /MP switch and I got multiple CPUs working and saved me 2 minutes off my debug build at work. Yeah!