profileExpr: Read Rprof Profile Data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/prof.R

Description

Return profile data collected while evaluating an expression.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

proftools documentation built on July 8, 2020, 5:20 p.m.