|
| 1 | +# see `help(run_script, package = 'touchstone')` on how to run this |
| 2 | +# interactively |
| 3 | + |
| 4 | +# TODO OPTIONAL Add directories you want to be available in this file or during the |
| 5 | +# benchmarks. |
| 6 | +# touchstone::pin_assets("some/dir") |
| 7 | + |
| 8 | +# installs branches to benchmark |
| 9 | +touchstone::branch_install() |
| 10 | + |
| 11 | +# benchmark a function call from your package (two calls per branch) |
| 12 | +touchstone::benchmark_run( |
| 13 | + # expr_before_benchmark = source("dir/data.R"), #<-- TODO OTPIONAL setup before benchmark |
| 14 | + runif_test = dqrng::dqrunif(1e6), #<- TODO put the call you want to benchmark here |
| 15 | + n = 10 |
| 16 | +) |
| 17 | + |
| 18 | +# benchmark a function call from your package (two calls per branch) |
| 19 | +touchstone::benchmark_run( |
| 20 | + # expr_before_benchmark = source("dir/data.R"), #<-- TODO OTPIONAL setup before benchmark |
| 21 | + rnorm_test = dqrng::dqrnorm(1e6), #<- TODO put the call you want to benchmark here |
| 22 | + n = 10 |
| 23 | +) |
| 24 | + |
| 25 | +# benchmark a function call from your package (two calls per branch) |
| 26 | +touchstone::benchmark_run( |
| 27 | + # expr_before_benchmark = source("dir/data.R"), #<-- TODO OTPIONAL setup before benchmark |
| 28 | + rexp_test = dqrng::dqrexp(1e6), #<- TODO put the call you want to benchmark here |
| 29 | + n = 10 |
| 30 | +) |
| 31 | + |
| 32 | +# TODO OPTIONAL benchmark any R expression (six calls per branch) |
| 33 | +# touchstone::benchmark_run( |
| 34 | +# more = { |
| 35 | +# if (TRUE) { |
| 36 | +# y <- yourpkg::f2(x = 3) |
| 37 | +# } |
| 38 | +# }, #<- TODO put the call you want to benchmark here |
| 39 | +# n = 6 |
| 40 | +# ) |
| 41 | + |
| 42 | + |
| 43 | +# create artifacts used downstream in the GitHub Action |
| 44 | +touchstone::benchmark_analyze() |
0 commit comments