benchmark_run | R Documentation |
Run a benchmark for git branches
benchmark_run(
expr_before_benchmark = {
},
...,
branches = c(branch_get_or_fail("GITHUB_BASE_REF"),
branch_get_or_fail("GITHUB_HEAD_REF")),
n = 100,
path_pkg = "."
)
expr_before_benchmark |
Expression to run before
the benchmark is ran, will be captured with |
... |
Named expression of length one with code to benchmark,
will be captured with |
branches |
Character vector with branch names to benchmark. The package
must be built for each benchmarked branch beforehand with |
n |
Number of times benchmarks should be run for each |
path_pkg |
The path to the package to benchmark. Will be used to temporarily checkout the branch during benchmarking. |
Runs the following loop n
times:
removes all touchstone libraries from the library path, adding the one
corresponding to branch
.
runs setup code exp_before_branch
.
benchmarks expr_to_benchmark
and writes them to disk.
All timings in a tibble.
This function will perform various git operations that affect the state of the directory it is ran in, in particular different branches will be checked out. Ensure a clean git working directory before invocation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.