Programming and Data Types | ![]() ![]() |
Viewing profile Results
There are two main ways to view profile
results:
To save results, see Saving Profile Reports.
Viewing profile Reports. To display profile
results, type
This suspends profile
and produces three reports:
The summary report appears in your system's default Web browser. Use the links at the top of the report page to see the other reports.
Summary profile Report. The summary report presents statistics about the overall execution and provides summary statistics for each function called. Values reported include
profile
time measurement. When Time for a function is 0, it is actually a positive value, but smaller than profile
can detect given the clock precision.
Note that profile
itself uses some time, which is included in the results.
Following is the summary report for the Lotka-Volterra model described in An Example Using profile.
Function Details profile Report. The function details report provides statistics for the parent and child functions of a function, and reports the line numbers on which the most time was spent. Following is the detail report for the lotka
function, which is one of the functions called in An Example Using profile.
Function Call History Profile Report. The function call history displays the exact sequence of functions called. To view this report, you must have started profile
using the -history
option.
The profile
function records up to 10,000 function entry and exit events. For more than 10,000 events, profile
continues to record other profile statistics, but not the sequence of calls. Following is the history report generated from An Example Using profile.
Profile Plot. To view a bar graph for the functions using the most execution time, type
This suspends the profile
. The bar graph appears in a figure window. Following is the bar graph generated from An Example Using profile.
Saving Profile Reports. When you generate the profile report, use the basename
option to save it. For example,
saves the profile report to the file basename
in the current directory. Later you can view the saved results using a Web browser.
Another way to save results is with the info = profile
function, which displays a structure containing profile
results. Save this structure so that later you can generate and view the profile report using profreport
(info)
.
Example Using Structure of Profiler Results. The profile
results are stored in a structure that you can view or access. This example illustrates how you can view the results:
profile
for code that computes the Lotka-Volterra predator-prey population model.
profile
results, type
![]() | An Example Using profile | Making Efficient Use of Memory | ![]() |