Skip to content

Performance Analysis Resources

Profiling

Codegen

  • Compiler Explorer: Tool for analyzing compiler codegen
    • Tip: Make sure to turn on optimizations (-O3). You will need to be careful to write your code in such a way that the compiler doesn't optimize it all away.

NOTE

It's a common pitfall to try to estimate x86 performance by eye. This is impossible to do on modern CPUs in general due to architecture details such as pipelining, superscalar pipelining, branch prediction, micro-architecture details, register renaming, etc. This is especially true for complicated architectures like x86. As such, it's necessary to alway profile and benchmark in addition to looking at the generated code.

x86


  1. This is an excellent tutorial for Instruments: https://www.jviotti.com/2024/01/29/using-xcode-instruments-for-cpp-cpu-profiling.html ↩︎