Profile a Function Call

Share:

Description

This is the workhorse function called by timeit, and is primarily meant to be called through timeit. However, if you desire a more direct wrapper to Rprof then this can be useful.

Usage

1
2
3
  do_timeit(call, replications = NULL, interval = 0.005,
    memory.profiling = FALSE, show.warnings = FALSE, i = 1,
    gcFirst = TRUE, gcDuring = FALSE)

Arguments

call

a call (typically passed down through timeit).

interval

real. time interval between samples.

replications

integer; by default NULL, which indicates we should 'guess' an appropriate number of replications. in order to more accurately profile quickly-running functions, we run the call replications times, and then infer the run-time as <time>/replications. by default, the argument is NULL and we attempt to infer an appropriate number of replications.

memory.profiling

logical. include memory use in output?

show.warnings

boolean. output a warning if any iteration of the run did not produce results?

i

integer. the iteration number. primarily for use from timeit.

gcFirst

boolean. run the garbage collector before any evaluation of the function call?

gcDuring

boolean. run the garbage collector before each iteration, as produced by replications? (very slow)

Value

A data.frame of the profiling times.