Tools for examining and displaying ouptut from the Rprof R
profiling tool.
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
1 2 3 4 5 6 7 | pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
funSummary(pd)
callSummary(pd)
pathSummary(pd)
hotPaths(pd)
plot(pd)
plot(filterProfileData(pd, focus = "glm", self.pct=1, total.pct=10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.