Compile time optimisation for C++
Nikolai Kutiavin
Professional problem solver in C++ and beyond | C++ design and architecture expert
Compile-time optimization is something that is usually applied last. Nevertheless, it has a direct impact on the cost savings of the development process, whether we are talking about computation power or the time of a developer.
Here I have a short list of tools that help to detect bottlenecks in compilation time:
The sequence of steps to reveal what goes wrong is simple:
ClangBuildAnalyzer provides insights on the most expensive:
If you need to understand what happened with a particular translation unit, you can open the corresponding generated JSON file with the Chrome trace viewer.
With this information, it's easy to detect bottlenecks in the compilation process. What you can do to eliminate these bottlenecks will be discussed in the following topics.