Information Technology Reference
In-Depth Information
Optimize the Build Process
Large code bases can cause the integration of software components to
take a considerably long time. To determine if the problem is related to
the size or integration of these components, ascertain the amount of
time the compile step is taking. If it turns out this step is taking a large
amount of time, perform an incremental build instead of a full build.
An incremental build will compile and/or regenerate only the files
that have changed. This can be risky because, depending on how this is
implemented, you may not receive all the benefits of CI. An effective
CI system is about reducing risks and, ideally, an integration environ-
ment should be cleaned by removing old files and then compiling/
regenerating the code to effectively determine if anything has broken.
Therefore, use incremental builds judiciously as you investigate other
areas that lead to slow-performing builds.
Some areas may lend themselves to an incremental build. For
example, if you have a Java system with a native DLL or shared object
library that rarely changes, it might be reasonable to only rebuild that
library once a day. In fact, some may argue that this infrequent DLL or
shared object be treated as a separate CI project and referenced as part
of your project using project dependencies.
Build System Components Separately
Sometimes integration builds take a long time to execute because of
the time it takes to integrate the source code and other associated files.
In this case, you can break apart the software into smaller subsystems
(modules) and build each of the subsystems separately.
To build the system components individually, create separate
projects for each subsystem that can be isolated. This can be done
from within a CI system—just make one of the subsystems the master
project. If there are any changes to one project based on the dependen-
cies, the other projects are rebuilt as well. Figure 4-7 demonstrates a
sample project layout based on separating the project into discrete
components to achieve faster builds.
Search WWH ::




Custom Search