Easily write and run large sets of benchmarks all at once, and collect results
in one output file. The autobenchR
package does not provide any benchmarking
functionality by itself, instead allowing for use of one of the following
packages: bench,
microbenchmark,
and rbenchmark.
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
remotes::install_github("bjmt/autobenchR")
autobenchR::begin("results.txt", tool = "bench")
autobenchR::run("Tests",
e1 = runif(100000, 0, 10),
e2 = rnorm(100000, 5, 2.5)
)
autobenchR::update(tool = "microbenchmark")
autobenchR::run("Different tool",
e1 = runif(100000, 0, 10),
e2 = rnorm(100000, 5, 2.5)
)
autobenchR::update(tool = "rbenchmark", unit = "ms")
autobenchR::run("Different tool 2",
e1 = runif(100000, 0, 10),
e2 = rnorm(100000, 5, 2.5)
)
autobenchR::skip()
autobenchR::run("Skipped tests",
e1 = sample(1:1000, 1000)
)
autobenchR::note(
"* Bullet point 1",
"* Bullet point 2",
name = "Some notes"
)
autobenchR::run("Failing test",
e1 = 1 + "a"
)
autobenchR::end()
Starting benchmarks
* Running benchmark 1: Tests [0.9 s]
* Running benchmark 2: Different tool [1.5 s]
* Running benchmark 3: Different tool 2 [1.7 s]
* Running benchmark 4: Skipped tests [SKIPPED]
* Running benchmark 6: Failing test [ERROR]
All benchmarks completed.
Total runtime: 4.1 seconds
See example-text.txt for the output file, and example-markdown.md for the markdown version.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.