benchmark.getDTeval {getDTeval}R Documentation

benchmark.getDTeval

Description

Performs a benchmarking experiment for data.table coding statements that use get() or eval() for programmatic designs. The a) original statement is compared to b) passing the original statement through getDTeval and also to c) an optimized coding statement. The results can demonstrate the overall improvement of using the coding translations offered by getDTeval()

Usage

benchmark.getDTeval(
  the.statement,
  times = 30,
  seed = 47,
  envir = .GlobalEnv,
  ...
)

Arguments

the.statement

refers to the original coding statement which needs to be translated to an optimized form. This value may be entered as either a character value or as an expression.

times

The number of iterations to run the benchmarking experiment

seed

an integer value specifying the seed of the pseudorandom number generator.

envir

The environment in which the calculation takes place, with the global environment .GlobalEnv set as the default.

...

provision for additonal arguments

Examples

#Benchmarking runtime performances in calculating mean age
dat<-formulaic::snack.dat
age.name<-'Age'
benchmark.getDTeval(the.statement = "dat[,.(mean_age=mean(get(age.name)))]", times = 5,  seed = 10)

[Package getDTeval version 0.0.2 Index]