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:
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.
The IncrediLink option can
speed up incremental links from minutes to a few seconds. See
here for more details.
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.
The following suggestions for changes in the project settings can
help improve build times specifically when using IncrediBuild:
- Disabling Browse Information - Browse information
creation 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 the IDE, either disable browse information creation or
simply set IncrediBuild's Browse Information Creation option to
'Never' in the Agent Settings dialog 'Visual Studio
Builds->Browse Information' page.
- Disabling incremental compilation and minimal rebuild (the
/Gi and /Gm compiler flags) - Disable these two options to gain
slightly better performance with IncrediBuild.
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.
- The Optimize project
build order option (enabled by default) automatically optimizes
the order in which IncrediBuild builds projects, according to the
solution/workspace's dependency information.
- You may specify Project
build priorities through the Solution Settings dialog to
control the order IncrediBuild will build projects, if
necessary.
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.