Improve performance when compiling with Build Automator

Build Automator uses MSBuild to compile projects and solutions no matter if they are in Visual Studio or in Clarion.  By default, MSBuild is a single thread program, but there is a way to tell it to start multiple processes to compile.

After some experiments on a virtual machine, I'd say it's definitely worth it to try it out and see if it helps.  What you need is the /maxcpucount parameter which you can add to the "Additional Parameters" tab on the "Call MS-Build" action in Build Automator.

Compile with MSBuild

The benefit may not be as much as you had hoped for, but it definitely does improve performance.  Here are some numbers.  This was tested on a Windows 10, 64bit virtual machine in VMWare 12.5.  It is set up with 5.7GB of RAM.  In the first test it was set to use 1 CPU and 2 cores.

15:42:59.898
15:45:54.809 00:02:54.911  without /maxcpucount
15:33:22.832
15:36:04.000 00:02:41.168 with /maxcpucount:2
15:52:48.811
15:55:21.083 00:02:32.272  with /maxcpucount:8

In this test, I was able to shave off about 38 seconds with the 8 CPU setting.  Your milage may certainly wary as this may be different outside of virtualized environment and it may be different depending on what CPU you have and a lot of other configurations.  No errors were reported and everything seemed to compile correctly.

All generated files were destroyed before each test and ClarionCL.exe was used to generate.  The Clarion IDE was not involved at all in this process and was closed while the testing was performed.  Only command line utilities.

Bottom line is if you are compiling larger solutions with Build Automator, then you should check out the /maxcpucount parameter.  For more information about this parameter, please see the information on the MSDN Website

Leave a Reply