summaryRprof {utils}R Documentation

Summarise Output of R Profiler

Description

Summarise the output of the Rprof function to show the amount of time used by different R functions.

Usage

summaryRprof(filename = "Rprof.out", chunksize = 5000)

Arguments

filename Name of a file produced by Rprof()
chunksize Number of lines to read at a time

Details

This function is an alternative to R CMD Rprof. It provides the convenience of an all-R implementation but will be slower for large files.

As the profiling output file could be larger than available memory, it is read in blocks of chunksize lines. Increasing chunksize will make the function run faster if sufficient memory is available.

Value

A list with components

by.self Timings sorted by ‘self’ time
by.total Timings sorted by ‘total’ time
sampling.time Total length of profiling run

See Also

The chapter on “Tidying and profiling R code” in “Writing R Extensions” (see the ‘doc/manual’ subdirectory of the R source tree).

Rprof

Examples

## Not run: 
## Rprof() is not available on all platforms
Rprof(tmp <- tempfile())
example(glm)
Rprof()
summaryRprof(tmp)
unlink(tmp)
## End(Not run)

[Package utils version 2.1.0 Index]