Learn R Programming

benchmarkme (version 1.0.8)

bm_parallel: Benchmark in parallel

Description

This function runs benchmarks in parallel to test multithreading

Usage

bm_parallel(bm, runs, verbose, cores, ...)

Arguments

bm

character name of benchmark function to run from get_available_benchmarks

runs

number of runs of benchmark to make

verbose

display messages during benchmarking

cores

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

Examples

Run this code
# 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