Skip to content

Profiling Compilation Times

s-trinh edited this page Nov 13, 2023 · 4 revisions

References:


Some notes about compilation profiling:

Install clang, something like sudo apt install clang should do the job.

At the ccmake step, use clang instead of gcc and pass the -ftime-trace flag:

  • C++ Compiler: /usr/bin/clang++
  • C++ flags (Release): -ftime-trace -Wall -Wextra -fopenmp=libomp -pthread -std=c++17 -fvisibility=hidden -mavx -fPIC -O3 -DNDEBUG

Use the Clang Build Analyzer tool, to build it:

  • clone it
  • in the ClangBuildAnalyzer folder: make -f projects/make/Makefile

Now, to build ViSP with profiling info and to analyse it:

  • ./ClangBuildAnalyzer --start <>/visp-clang-build
  • make -j (in the <>/visp-clang-build folder)
  • ./ClangBuildAnalyzer --stop <>/visp-clang-build visp-clang_build_session_analyse.bin
  • ./ClangBuildAnalyzer --analyze visp-clang_build_session_analyse.bin

Information about compilation profiling should be printed in the terminal: Analyzing build trace from 'visp-clang_build_session_analyse.bin'...

You can also use the See++ Compiler Profiler tool for visual profiler information:

image