
This function runs benchmarks in parallel to test multithreading
bm_parallel(bm, runs, verbose, cores, ...)
character name of benchmark function to run from get_available_benchmarks
number of runs of benchmark to make
display messages during benchmarking
number of cores to benchmark. If cores is specified, the benchmark is also run for cores = 1 to allow for normalisation.
additional arguments to pass to bm
# NOT RUN {
bm_parallel("bm_matrix_cal_manip", runs = 3, verbose = TRUE, cores = 2)
bm = c("bm_matrix_cal_manip","bm_matrix_cal_power", "bm_matrix_cal_sort",
"bm_matrix_cal_cross_product", "bm_matrix_cal_lm")
results = lapply(bm, bm_parallel,
runs = 5, verbose = TRUE, cores = 2L)
# }
Run the code above in your browser using DataLab