Profiling (computer programming): Difference between revisions

Content deleted Content added
Adding local short description: "Measuring the time or resources used by a section of a computer program", overriding Wikidata description "technique of measuring the amount of time or other resources used by different components of an executing computer program" (Shortdesc helper)
SdkbBot (talk | contribs)
Line 71:
Some profilers operate by [[Sampling (statistics)|sampling]]. A sampling profiler probes the target program's [[call stack]] at regular intervals using [[operating system]] [[interrupt]]s. Sampling profiles are typically less numerically accurate and specific, but allow the target program to run at near full speed.
 
The resulting data are not exact, but a statistical approximation. "The actual amount of error is usually more than one sampling period. In fact, if a value is n times the sampling period, the expected error in it is the square-root of n sampling periods." <ref>[http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC12 Statistical Inaccuracy of <tt>gprof</tt> Output] {{webarchive|url=https://web.archive.org/web/20120529075000/http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html |date=2012-05-29 }}</ref>
 
In practice, sampling profilers can often provide a more accurate picture of the target program's execution than other approaches, as they are not as intrusive to the target program, and thus don't have as many side effects (such as on memory caches or instruction decoding pipelines). Also since they don't affect the execution speed as much, they can detect issues that would otherwise be hidden. They are also relatively immune to over-evaluating the cost of small, frequently called routines or 'tight' loops. They can show the relative amount of time spent in user mode versus interruptible kernel mode such as [[system call]] processing.