/cppcon2017

Optimizing compilation times of Generated Code with Templates

Primary LanguageThriftMIT LicenseMIT

cppcon2017

Optimizing compilation times of Generated Code with Templates

Requirements:

Build the tools:

  • ./tools/build_deps.sh

This will download, patch, and build clang, llvm, and templight.

What do the patches include?

Time Report:

These patches add modifications to Clang's frontend to gather more metrics on compilation times

Templight:

Tools:

How to use:

If you have CMake follow: example/CMakeLists.txt

Time Report:

  • ./external/llvm_build/bin/clang++ -ftime-report a.cpp

Templight:

  • ./external/llvm_build_bin/templight++ -Xtemplight -profiler -Xtemplight -ignore-system -c a.cpp
  • ./tools/get_inst_times.sh results your_build/file.cpp.o.trace.pbf

For more flags that you can use for templight, visit the github in the Requirement section. In general, "profiler" and "ignore-system" have been the most useful ones.

Questions?

Please create a github issue and we can start a discussion!