User Tools

Site Tools


profiling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
profiling [2015/01/09 14:56]
rryan created
profiling [2015/01/09 15:57] (current)
ywwg
Line 1: Line 1:
 ====== Profiling ====== ====== Profiling ======
  
-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. ​+Profiling is a method for analyzing the performance characteristics of a program. ​There are a variety of types of profilers out there (instrumentation,​ statistical,​ emulation, etc.).  
 + 
 +===== Statistical Profilers ===== 
 + 
 +Statistical profilers work 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 statistical profiling tell you? ====
  
-===== What can profiling tell you? ===== 
  
   * The number of times the program counter was on a given line of code during a sample.   * The number of times the program counter was on a given line of code during a sample.
Line 10: Line 15:
   * Usually a profiler can connect the source code with the assembly ​   * Usually a profiler can connect the source code with the assembly ​
  
-===== What can't profiling tell you? =====+ 
 +==== What can'​t ​statistical ​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.).   * 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).   * 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).
  
 +
 +===== Tools =====
 +
 +==== GProf (Linux, BSD, Mac OS X) ====
 +
 +==== LTTNG (Linux only) ====
 +
 +==== XCode / Instruments (Mac OS X only) ====
 +
 +==== Valgrind ====
 +
 +==== Callgrind / KCacheGrind ====
 +
 +==== Mutrace ====
profiling.1420833378.txt.gz · Last modified: 2015/01/09 14:56 by rryan