Improving Visual Studio Build Performance - Tips

In certain cases, it may be possible to further improve build speed of MS Visual Studio projects by fine-tuning certain aspects of either IncrediBuild's configuration or the project settings. This section lists common causes for not obtaining optimal results using IncrediBuild. Different environments and projects will respond differently to a change in configuration, so the best way to go is to try out the different suggestions and see the effect each has on build time.

For additional important performance-related tips see this section.

Tips in this Section:

Using the "IncrediBuild_AllowOverlap" Directive

The IncrediBuild_AllowOverlap directive may speed up builds in cases where dependencies between projects are defined in a solution/workspace, and project-level custom build steps or build events (post-build, pre-link, etc.) are used in these projects.
Take the following case: project B is a sub-project of project A, and contains a project-level custom build step, a pre-link step or a post-build step. Consequently, project A will not start to compile until project B's step has been performed. While this ensures that projects will successfully be built as long as dependencies have correctly been defined, it may also unjustifiably slow down the build if project B's step is not required by project A's source files. In this case, using the IncrediBuild_AllowOverlap directive will instruct IncrediBuild not to postpone project A's compilation.

Using the IncrediBuild_AllowOverlap directive is explained in full detail in this section.

Enabling IncrediLink

The IncrediLink option can speed up incremental links from minutes to a few seconds. See here for more details.

Distributing Custom Build Steps, Custom Build Rules and Build Events

If custom build steps, files running custom build rules or build events (pre-build, pre-link and post-build) take up a large portion of your build time, it may be a good idea to consider using the optional XGE Interfaces extension package to distribute execution of these steps in addition to compilation and MIDL steps. For more information on how to distribute these steps, see this section.

Optimizing Project Settings

The following suggestions for changes in the project settings can help improve build times specifically when using IncrediBuild:

Limiting the number of PDB files

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. The Agent Settings dialog Visual Studio Builds->Advanced page allows you to limit the number of PDB files that will be created in each project's intermediate folder. 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, so it is generally advised to use this option only if your builds typically include files from of a relatively large number of projects.

Optimizing Project Build Order

Allowing Custom Build Steps to Run in Parallel

Another possible optimization is to allow custom build steps to be run simultaneously, on more than one CPU/core, in the local machine. This option is disabled by default, and can be enabled using the Agent Settings dialog Visual Studio Builds->General page.
Copyright (C) 2001-2008 Xoreax Software Ltd. All rights reserved.
Converted from CHM to HTML with chm2web Standard 2.7 (unicode)