benchmarks_code: Run benchmark for R code across R implementation and platform

Description Usage Arguments Examples

View source: R/benchmark.R

Description

Run benchmark for R code across R implementation and platform.

Usage

1
2
3
benchmarks_code(code, platforms = c("debian", "ubuntu"),
  r_implementations = c("gnu-r", "mro"), volumes = NULL, times = 3,
  pull_image = FALSE, ...)

Arguments

code

An expression or string of R code

platforms

List of platforms

r_implementations

List of R implementations

volumes

Volume mapping from host to container. Passed to run_code

times

How many times the code will be run. Passed to microbenchmark

pull_image

If set to TRUE, the needed docker image will be pulled first

...

Parameters for microbenchmark

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
benchmarks_code(code = "1 + 1", times = 3)

# This code below is for running sample, need to set proper directory
code = expression(setwd('/home/docker/sdsr'),
                    bookdown::clean_book(TRUE),
                    unlink('_book/', recursive=TRUE),
                    unlink('_bookdown_files', recursive=TRUE),
                    bookdown::render_book('index.Rmd', 'bookdown::gitbook')
)
benchmarks_code(code = code,
                volumes = '/home/ismailsunni/dev/r/sdsr:/home/docker/sdsr',
                times = 3)
benchmarks_code(code = code,
                platforms = c("debian", "ubuntu", "fedora"),
                volumes = '/home/ismailsunni/dev/r/sdsr:/home/docker/sdsr',
                times = 3)

## End(Not run)

ismailsunni/altRnative documentation built on April 1, 2020, 2:22 a.m.