Profiling (computer programming): Difference between revisions

Content deleted Content added
Araud (talk | contribs)
m Use of profilers: -</code> +{{quotation}}
Line 9:
== Use of profilers ==
[[File:CodeAnalyst3.png|thumb|Graphical output of the [[CodeAnalyst]] profiler.]]
{{quotation|
<blockquote>
"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 sections of code. [[Compiler]] writers often use such tools to find out how well their [[instruction scheduling]] or [[branch prediction]] algorithm is performing..." ''-- (|ATOM, |[[Conference on Programming Language Design and Implementation|PLDI]], |'94)''}}
</blockquote>
 
The output of a profiler may be:
Line 17 ⟶ 16:
* A statistical ''summary'' of the events observed (a '''profile''')
:Summary profile information is often shown annotated against the source code statements where the events occur, so the size of measurement data is linear to the code size of the program.
 
:<code>
/* ------------ source------------------------- count */
0001 IF X = "A" 0055
Line 24 ⟶ 23:
0004 ELSE
0005 IF X = "B" 0055
 
</code>
* A stream of recorded events (a '''trace''')
:For sequential programs, a summary profile is usually sufficient, but performance problems in parallel programs (waiting for messages or synchronization issues) often depend on the time relationship of events, thus requiring a full trace to get an understanding of what is happening.