Basics of Profiling

01 Mar 2022

[ c++  performance  debug  ]

Here’s how I found what was slow.

Sampling Profiling

Instrumentation profiling

Setup goals

Use the right tool

Best work is no work

Profiling metrics

High CPU time

High wait time

Inefficient algorithms

Inefficient data structures

Spin Locks

Single threaded code

Micro-architecutre usage

Blocking I/O

Wait on Mutex or Semaphore

Deal with inefficient algorithms, data structures and locks first.

References