The source code for the compiler time tracker is available at nikic/llvm-compile-time-tracker. The raw data is available at nikic/llvm-compile-time-data.

Pre-Commit Measurements

If you have LLVM commit access, you can post a comment starting with /compile-time on a pull request to start a measurement.

If you regularly do compile-time sensitive work, you can also request your llvm-project fork to be added to the compile-time tracker by contacting llvm@npopov.com. Once your fork is added, any branches starting with `perf/` will get measured. This allows you to test changes without opening a pull request, and allows you to test multiple commits on a branch.

Reproducing

The compile time tracker tests the CTMark portion of the LLVM test-suite against specific cached CMake configurations. You can set up a test-suite build as follows:

git clone https://github.com/llvm/llvm-test-suite.git
mkdir build
cd build
cmake .. -G Ninja \
    -C ../cmake/caches/$CONFIG.cmake \
    -DCMAKE_C_COMPILER=$PATH_TO_CLANG

The $CONFIGs used by the tracker are O3, ReleaseThinLTO, ReleaseLTO-g and O0-g.

Next, you will want to pick out a single file with a particularly large regression by enabling the "Per-file details" checkbox on the comparison page. Let's assume we pick CMakeFiles/lencod.dir/rdopt.c.o. The compiler invocation can be obtained using `ninja -v lencod`, after which it can be modified to prepend your favorite profiling tool. For example:

valgrind --tool=callgrind $PATH_TO_CLANG -DNDEBUG  -O3   -w -Werror=date-time -fcommon -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -MD -MT MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o -MF MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o.d -o MultiSource/Applications/JM/lencod/CMakeFiles/lencod.dir/rdopt_coding_state.c.o   -c ../MultiSource/Applications/JM/lencod/rdopt_coding_state.c

Configurations

Compilers:

Displayed statistics for clang generally refer to the stage2 build. The stage1 build uses ccache and as such does not produce stable timing results.

Tested configurations: