summaryRprof {utils} | R Documentation |
Summarise the output of the Rprof
function to show the
amount of time used by different R functions.
summaryRprof(filename = "Rprof.out", chunksize = 5000)
filename |
Name of a file produced by Rprof() |
chunksize |
Number of lines to read at a time |
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.
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 |
The chapter on “Tidying and profiling R code” in “Writing R Extensions” (see the ‘doc/manual’ subdirectory of the R source tree).
## Not run: ## Rprof() is not available on all platforms Rprof(tmp <- tempfile()) example(glm) Rprof() summaryRprof(tmp) unlink(tmp) ## End(Not run)