proftools provides a set of tools for summarizing and displaying
time profile outpus produced by R's Rprof
.
The starting point for a profiling analysis using proftools is
to profile code using Rprof
and then use
readProfileData
to read in the profile data into a
sutable format for furhter processing. An alternative is to use the
profileExpr
function to handle profiling and reading in
one step. The function filterProfileData
can be used to
narrow the profile data to particular regions of interest.
The summary functions funSummary
and
callSummary
produce summaries at the function and call
level. pathSummary
produces a summary for each unique
call stack, or path; and hotPaths
identifies produces
path data ordered to show the hottest paths first.
If source information is recorded when profiling then
srcSummary
to show profiling by source lines, and
annotateSource
produces an annotated version of the
source files.
The plot
method for profile data objects can produce
call graphs, tree maps, flame graphs, and time graphs; the
type
argument choses the particular visualization to
produce. These graphs can also be produced by the functions
plotProfileCallGraph
, calleeTreeMap
, and
flameGraph
.
The function writeCallgrindFile
writes a file for use
by the codekcachegrind program available on some operating
systems.
flatProfile