benchmarkito: Utility to benchmark expression in R

View source: R/benchmark.R

benchmarkitoR Documentation

Utility to benchmark expression in R

Description

This is just an internal utility included in the package which is not designed to be accurate. If you need accurate benchmarks, you should take a look at the microbenchmark and bench R packages.

Usage

benchmarkito(..., times = 100, rand_ord = TRUE)

Arguments

...

List of expressions to benchmark.

times

Integer scalar. Number of replicates.

rand_ord

Logical. When TRUE, the expressions are executed in a random order.

Details

The print method prints a summary including quantiles, relative elapsed times, and the order (fastest to slowest).

Value

A data frame of class ergmito_benchmark with times rows and the following columns:

  • id Integer. Id of the expression.

  • expr Factor. Expression executed.

  • user.self, sys.self, elapsed, sys.child time in seconds (see proc.time()).

Includes the following attributes: ncalls, call, label, and expr.

Examples

bm <- benchmarkito(
  exp(1:100000),
  sqrt(1:100000),
  times = 20
)

plot(bm)
print(bm)


ergmito documentation built on July 9, 2023, 7:09 p.m.