User Tools

Site Tools


This is an old revision of the document!


Profiling is a statistical method for analyzing the performance characteristics of a program. It works by using operating system provided hooks to stop the program being profiled at a fixed sampling interval (typically 1ms or shorter). Every time the program is stopped the profiler takes a backtrace of every thread. This gives the profiler a snapshot of what the program was doing at that instant. The profiler tabulates the number of times a given piece of code appears in a sample to give you an estimate of how “expensive” a function is in relation to the rest of the tasks the program is performing.

What can profiling tell you?

  • The number of times the program counter was on a given line of code during a sample.
  • The relative CPU burden of different tasks a program performs by comparing the number of samples that fall within two execution paths.
  • The various code paths taken by a particular execution tree in your program. (i.e. – “Hey I didn't realize this code somehow called QVector::expensiveCopy!”).
  • Usually a profiler can connect the source code with the assembly

What can't profiling tell you?

  • How expensive a function is in absolute terms (i.e. how long a function takes to complete, statistics about methods that Mixxx's performance timers might provide, etc.).
  • The full set of functions that are called by another function (if they don't appear in a sample then they will appear to not exist to the profiler).
Translations of this page:
profiling.1420833378.txt.gz · Last modified: 2015/01/09 14:56 by rryan