Profiling (computer programming): Difference between revisions

Content deleted Content added
rewrite first few paras
No edit summary
Line 1:
:''"Profiling" redirects here. For the science of criminal psychological analysis, see [[Offender profiling|offender profiling]].''
 
In [[software engineering]], '''performance analysis''' (also known as '''dynamic program analysis''') is the investigation of a program's behavior using information gathered as the program runs, as opposed to [[static code analysis]]. The usual goal of performance analysis is to improvedetermine which parts of a program's to [[optimization (computer science)|optimize]] for speed or memory usage.
 
A '''profiler''' is a performance analysis tool that measures the behavior of a program as it runs, particularly the frequency and duration of function calls. The output is a stream of recorded events (a '''trace''') or a statistical summary of the events observed (a '''profile'''). Profilers use a wide variety of techniques to collect data, including hardware interrupts, code instrumentation, operating system [[hooking|hooks]], and performance counters.
Line 9:
 
:''Program analysis tools are extremely important for understanding program behavior. Computer architects need such tools to evaluate how well programs will perform on new [[computer architecture|architectures]]. Software writers need tools to analyze their programs and identify critical pieces of code. [[Compiler]] writers often use such tools to find out how well their [[instruction scheduling]] or [[branch prediction]] [[algorithm]] is performing...'' (ATOM, [[PLDI]], '94)
 
Performance analysis is often used to determine how long certain parts of the program take to execute, how often they are executed, or to generate the [[call graph]] (the [[Graph (mathematics)|mathematical graph]] of which [[Subroutine|functions]] call which other functions). Typically this information is used to identify those portions of the program that take the longest to complete. These time consuming parts can then be [[Optimization (computer science)|optimized]] to run faster. It is also a common technique for [[debugging]].
 
==History==