Benchmarking of arbitrary R code, inspired by similar functionality in a Perl module, is implemented via a simple wrapper around system.time(). Given a specification of the benchmarking process (counts of replications, evaluation environment) and an arbitrary number of expressions, the function evaluates each of the expressions in the specified environment, replicating the evaluation as many times as specified, and returning the results conveniently wrapped into a data frame.
The package is on CRAN and can be installed via
> install.packages("rbenchmark")The r-univere page
has source and binary builds from the repository version which may
differ from the CRAN version and shows how to install them. Lastly, one
can always rely on remotes::install_github():
> remotes::install_github("eddelbuettel/rbenchmark")Wacek Kusnierczyk created the package; Dirk Eddelbuettel and Berend Hasselman provided additional pieces.
Dirk Eddelbuettel adopted the package in 2026 (having already filled in during 2012).
GPL (>= 2)