Build Performance Optimizations
In certain cases, it may be possible to further optimize build speeds of MS Visual Studio projects by fine-tuning certain aspects of either Incredibuild's configuration or the project's settings.
For additional important performance-related tips, see General Performance Boost Tips.
Optimizing Project Settings
The following changes in the project settings can help improve build times, specifically when using Incredibuild:
-
Disabling Browse Information – Creation of browse information lengthens each file's compilation time, adds additional network strain, and adds an extra step at the end of each build for the creation of the .BSC file. If you typically don't use this feature of Visual Studio, either disable browse information creation or simply set Incredibuild's Browse Information Creation option (Generate .BSC (Source Browser database) file) to Never in Agent Settings > Visual Studio Builds > Browse Information.
-
Disabling incremental compilation and minimal rebuild (the /Gi and /Gm compiler flags) – Disable these two options to gain slightly better performance with Incredibuild.
Limiting the Number of PDB Files
This feature is relevant for Visual Studio 2012 and later, and for Visual Studio 2011 when Support, as a solution to a user's problem, advises to set the PdbForwardingMode flag in the registry to 0.
To achieve its distribution, Incredibuild creates a separate PDB file for each Agent running at any given time. This means that, unlike standard MSVC builds, multiple PDB files are created in intermediate folders, which can potentially slow down the link phase. You can limit the number of PDB files.
While this may speed up linking, it also means that you are limiting the number of Agents allowed to concurrently compile files from the same project. Therefore, it is generally advised to use this option only if your builds typically include files from a relatively large number of projects.
>To limit the number of PDB files:
-
Go to Agent Settings > Visual Studio Builds > Advanced, and set a limit.
Preventing Link Steps from Running in Parallel on the Local Machine
Allowing link steps to run in parallel on the initiating machine (assuming it has multiple cores/CPUs and has the Multiple CPUs/Cores extension package assigned) may sometimes result in an improvement in build performance. However, if your link steps typically consume a lot of memory and your machine does not have sufficient physical memory to support multiple link steps, this might slow down builds as a result of excessive page file swapping.
>To configure parallelization of link steps:
-
Go to Agent Settings > Visual Studio Builds > General, and specify the CPU/core utilization.
Setting a Specific Project to Run Locally
Distribution of heavy tasks to remote agents might lead to a high I/O ratio on the Initiator machine, which can lead to an increase in the build time. The projects containing those heavy tasks can be defined to run only on the local machine.
>To mark a project to run only locally:
-
Right-click the project in Visual Studio, and select Properties > Configuration Properties > C/C++ >Preprocessor Definitions.
-
Add the following string to the Preprocessor Definitions section:IB_RunLocal
Synchronizing Specific Files Back to the Initiator Machine
This procedure is relevant for processes that are defined as VC compiler = true. For example, the Microsoft compiler and Intel compiler, which are defined in Incredibuild to return OBJ files. If you want them to return other files, you can explicitly define the files that should be synchronized back to the Initiator machine.
>To define files to be synchronized back to the Initiator machine:
-
On the Coordinator machine, right-click the Incredibuild tray icon, and select Coordinator Monitor.
-
In the list of agents, right-click the initiator agent, and select Set Registry Value....
-
Ensure that Value Category is set to Builder.
-
Under Name, type AdditionalOutputMasks.
-
Under Data, type one of the following strings:*.txt to return all *.txt files.*.txt;*.xml to return all *.txt files as well as all *.xml files.
-
ClickOK.The registry value is added to the Initiator machine.