Core Concepts
Bazel's parallelization and incremental build features can significantly speed up long-duration builds in continuous integration, but their adoption and effectiveness vary across open-source projects.
Abstract
The study investigates the usage and performance impact of Bazel's parallelization and incremental build features in continuous integration (CI) builds.
Key highlights:
- 31.23% of Bazel projects adopt a CI service but do not use Bazel in the CI service, as Bazel is adopted for other purposes beyond just building projects.
- For projects that use Bazel in CI, 26.36% of them use additional tools like Shell scripts, Make, and Docker to facilitate the execution of Bazel.
- All studied Bazel projects in the 4 CI services (GitHub Actions, CircleCI, Travis CI, Buildkite) use Bazel's parallel build feature, but only 44.08% of them use caching to speed up build performance.
- Bazel's parallelization can significantly improve the build performance for long-build duration projects, with median speedups of 2.00x, 3.84x, 7.36x, and 12.80x at parallelism degrees 2, 4, 8, and 16, respectively.
- However, at parallelism degree 16, 100% of short, 96% of medium, and 83% of long-build duration projects are unable to fully harness the benefits of parallelism.
- Caching of build dependencies in CI can slow down builds, with only 52.17% of short, 8.70% of medium, and 4.17% of long-build duration projects exhibiting improved build performance compared to clean builds.
- Caching of build results (incremental build) can greatly help reduce the build time for medium- and long-build duration projects, with median speedups of 1.21x-1.25x and 4.22x-4.71x, respectively.
The results provide guidance for developers to improve the usage of Bazel in their projects and emphasize the importance of exploring modern build systems due to their potential advantages within contemporary software practices.
Stats
The median baseline build times for short-build duration projects are 44.74s, 253.41s, and 108.88s.
The median baseline build times for medium-build duration projects are 258.21s, 850.49s, and 467.78s.
The median baseline build times for long-build duration projects are 935.84s, 14836.71s, and 1801.53s.
Quotes
"Bazel's parallelization can significantly improve the build performance for long-build duration projects, with median speedups of 2.00x, 3.84x, 7.36x, and 12.80x at parallelism degrees 2, 4, 8, and 16, respectively."
"Caching of build results (incremental build) can greatly help reduce the build time for medium- and long-build duration projects, with median speedups of 1.21x-1.25x and 4.22x-4.71x, respectively."