| profileExpr {proftools} | R Documentation |
Read Rprof Profile Data
Description
Return profile data collected while evaluating an expression.
Usage
profileExpr(expr, GC = TRUE, srclines = TRUE, memory = TRUE)
Arguments
expr |
Valid R expression to be profiled. |
srclines |
logical; include source information, if available, or not. |
GC |
logical; include GC information or not. |
memory |
logical; include memory use information or not. |
Details
profileExpr uses Rprof to profile execution of
expr and returns the profile data read in using
readProfileData. By default GC and source information
are included in the profile data. If memory profiling is supported,
memory use information is also included by default.
Value
R representation of Rprof data.
Author(s)
Luke Tierney
See Also
Rprof,
funSummary,
srcSummary,
plotProfileCallGraph,
Examples
## This defines the function rw()
source(system.file("samples", "rw.R", package="proftools"))
## Execute the function and collect profile data
pd <- profileExpr(rw(200000))
## Examine the profiel data
funSummary(pd)
callSummary(pd)
hotPaths(pd)
srcSummary(pd)
plotProfileCallGraph(pd)
[Package proftools version 0.99-3 Index]