Clang: How to Analyse Compiletime of Templates?

hello clang-devs,

is clang able to help me to finde the most compiletime consuming
templates in a 500KLOC app
which uses a huge template library - something like a overview what
templates are reasonable to optimize
(in my case hide the template behind a specialized interface)

i've read about /ftime

but that seems no to help with template instanciation

any advice?

Hi Dennis,

Along with -ftime-trace, try either:
- Clang Build Analyzer: Clang Build Analyzer ยท Aras' website
- See++ Compiler Profiler: GitHub - Viladoman/SeeProfiler: Clang C/C++ Visual Profiler for compile times visualization

-----Message d'origine-----

Thx for the links, very promising

You can also take a look at templight:

i get this assertion (using latest Windows
Build( installer + VStudio extension)

1>Assertion failed: TimeTraceProfilerInstance == nullptr && "Profiler
should not be initialized", file
line 253
1>Stack dump:

assert in Function: void timeTraceProfilerInitialize(unsigned

-ftime-trace Option gives this error on both Project properties

VStudio Project properties
Configuration Properties -> C/C++ -> Command Line
Configuration Properties -> LLVM -> Additional Compiler Options

the very same LLVM/clang-cl installation works with -ftime-trace on a
much bigger project of my colleague