arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.00796cs.SE
收藏

使用 Bazel 是否有助于加速持续集成构建?

Does Using Bazel Help Speed Up Continuous Integration Builds?

Shenyu Zheng, Bram Adams, Ahmed E. Hassan

AI总结:

本研究通过分析383个GitHub上的Bazel项目,评估了Bazel在CI中的并行与增量构建性能,发现其在长构建项目中能显著提升速度,为开发者优化CI构建提供了实证指导。

摘要:

漫长的持续集成(CI)构建迫使开发者在开始后续开发活动前等待 CI 反馈,导致时间浪费。除了过去研究的各种构建调度和测试选择启发式方法外,像 Bazel 这样基于制品的新构建技术内置了对并行构建和增量构建(构建结果缓存)等高级性能优化的支持。然而,对于像 Bazel 这样的新构建技术在多大程度上兑现了其承诺的益处,尤其是对于长构建持续时间项目,人们知之甚少。在本研究中,我们从 GitHub 收集了 383 个 Bazel 项目,然后在 4 个流行的 CI 服务中研究了它们对 Bazel 并行和增量构建的使用情况,并将结果与 Maven 项目进行了比较。我们在 383 个 Bazel 项目上进行了 3,500 次实验,并分析了其中 70 个可构建项目子集的构建日志,以评估 Bazel 并行构建的性能影响。此外,我们在 70 个可构建项目的最近 100 次提交上进行了 102,232 次实验,以评估 Bazel 的增量构建性能。结果显示,31.23% 的 Bazel 项目采用了 CI 服务但未在该 CI 服务中使用 Bazel,而对于那些确实在 CI 中使用 Bazel 的项目,27.76% 使用其他工具来促进 Bazel 的执行。与顺序构建相比,长构建持续时间项目在并行度 2、4、8 和 16 时的中位加速比分别为 2.00 倍、3.84 倍、7.36 倍和 12.80 倍;同时,与全新构建相比,应用增量构建为长构建持续时间项目实现了 4.22 倍(使用构建系统工具无关的 CI 缓存)和 4.71 倍(使用构建系统工具特定的缓存)的中位加速比。我们的结果为开发者改善 Bazel 在其项目中的使用提供了指导。

英文摘要:

A long continuous integration (CI) build forces developers to wait for CI feedback before starting subsequent development activities, leading to time wasted. In addition to a variety of build scheduling and test selection heuristics studied in the past, new artifact-based build technologies like Bazel have built-in support for advanced performance optimizations such as parallel build and incremental build (caching of build results). However, little is known about the extent to which new build technologies like Bazel deliver on their promised benefits, especially for long-build duration projects. In this study, we collected 383 Bazel projects from GitHub, then studied their parallel and incremental build usage of Bazel in 4 popular CI services, and compared the results with Maven projects. We conducted 3,500 experiments on 383 Bazel projects and analyzed the build logs of a subset of 70 buildable projects to evaluate the performance impact of Bazel's parallel builds. Additionally, we performed 102,232 experiments on the 70 buildable projects' last 100 commits to evaluate Bazel's incremental build performance. Our results show that 31.23% of Bazel projects adopt a CI service but do not use Bazel in the CI service, while for those who do use Bazel in CI, 27.76% of them use other tools to facilitate Bazel's execution. Compared to sequential builds, the median speedups for long-build duration projects are 2.00x, 3.84x, 7.36x, and 12.80x, at parallelism degrees 2, 4, 8, and 16, respectively, even though, compared to a clean build, applying incremental build achieves a median speedup of 4.22x (with a build system tool-independent CI cache) and 4.71x (with a build system tool-specific cache) for long-build duration projects. Our results provide guidance for developers to improve the usage of Bazel in their projects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑