Is your C++ build slow or unintelligible? We are currently looking for more case studies. If you are interested in improving your Linux-based build (commercial or open-source), please get in touch!
The C++ community is fragmented due to the variety of build-systems used. This fragmentation makes it difficult to:
For the C++ community this means:
By recording the build process at a system-level, we can infer high-level information about the project structure. Since BuildInfer records at this low-level, our technique works for any C++ build system.
Once we have a high-level build description, we can visualize, transform and even port complex build-systems to more powerful ones, such as Buck and Bazel.
We have already had success porting the following projects to Buck:
Furthermore, we discovered that none of these projects ship with a reproducible build-system! By porting them to Buck, we can guarantee this.
Reproducible builds are crucial for security, cache performance and debugging. For more information, see:
Mapnik is an open source mapping toolkit for desktop- and server-based map rendering, written in C++.
-fvisibility=inline
and shared builds to prevent symbol clashes. We identified that the core issue are non static definitions within this header-file using BuildInfer’s output.
View the full SVG image on GitHub
The graph tells us the following:
*.os
extensionscons/scons.py
The LLVM compiler infrastructure project is a “collection of modular and reusable compiler and toolchain technologies” used to develop compiler front ends and back ends.
We also performed a simple analysis of the build-times in the context of the dependency graph. These tables show the estimated cost of changing various files in LLVM by summing the time taken to build each file plus all of its dependees.
These files are “hot-spots” for incremental builds, and might be good candidates for refactoring.
Please note that these numbers are assuming a single-threaded build; a real build would take some scale-factor of these times.
The header llvm-config.h
is particularly interesting. It defines some constants referenced throughout the project:
So every time the version string or default target is changed, LLVM incurrs a (scale-factor of) 15,264 second
build! These values could potentially be refactored into a translation-unit:
We also generated a graph showing the interaction of individual file groups and executables:
View the full SVG image on GitHub
The graph show us that:
*.export
*.td
files are used by tblgen
to generate *.inc
header files.tblgen
(how do they differ?)OpenCV is a library of programming functions mainly aimed at real-time computer vision.
We also generated a graph showing the interaction of individual file groups and executables:
View the full SVG image on GitHub
*.cl
files are used by cl2cpp.cmake
to generate *.cpp
filespkg-config
is generated by OpenCVGenPkgconfig.cmake
*.gch
and the header entrypoint is not generated.Is your C++ build slow or unintelligible? We are currently looking for more case studies. If you are interested in improving your Linux-based build (commercial or open-source), please get in touch!
7 Reasons to Use Buck Build_Buck is a cross-platform, cross-language build system made for large scale compilation at Facebook. All Buckaroo…_hackernoon.com