I have a large c++ project that I am compiling with MS VS 2012 from within the IDE.
I have enabled Multi-processor compilation (/MP)
and the build begins in parallel (I know this because 8 cl.exe
instances are visible in Task Manager). However, after a dozen or so files are completed the build seems to be serial again, with only one instance of cl.exe
remaining.
I have checked for incompatible options (as indicated here) and everything seems correct. I have also built using jom
from command line and the build is much faster and uses all cores have a much greater portion of the build time.
Questions:
Is there a limitation when building in parallel within VS?
Or is there some new setting I may be missing?
Any suggestions are welcomed.
EDIT:
Here are some screenshots showing what's going on. When a build first starts, I get lots of compiling happening (see the many instances of c1.exe in Task Man), but after just a minute or so I am down to one or two instances. This doesn't seem to be a compiler limitation or project issue, because building with jom is about 4-5 times faster (using the VS compiler still) than building from within the VS IDE.
VS 2012 Immediately after starting a build
VS 2012 One minute after build started