c++visual-studiovisual-c++visual-studio-2013visual-c++-2013

How to limit the number of parallel cl.exe processes during the Visual Studio solution build?


I've recently noticed that once I start building the Visual Studio solution I'm working with (~200 C++ projects), I get a very large number of cl.exe processes. Task manager screenshot

I'm not surprised by the fact of several cl.exe running in parallel, because my projects are set up with /MP option. Project settings in one of the projects

But I would expect that their number would be limited by the following setting in the Visual Studio "Options". Visual Studio settings (Tools -> Options)

I presume that running tens of processes in parallel on the 4-core PC is not the most efficient way to build the solution.

So, basically I've got two questions:

P.S. I normally compile my solution with Visual Studio 2013 Update 4, but the same behavior can be observed with Visual Studio 2017.


Solution

  • I think you need to read this where the conclusion is that you need to set up your compilation to fit VS idea of the world.

    Also limit the number of parallel projects to 2-3 depending on the actual PC you run it on. If your PC is a monster with 16+ cores you might be able to go 1-2 up.

    Ideally VS should have offered an option of using X threads but alas.