Skip to content

Benchmarks

Karolis Koncevičius edited this page Sep 24, 2021 · 10 revisions

Running times for the implemented tests.

Settings

  • Benchmarks were computed using matrices with varying numbers of rows and columns.
  • All benchmarks were produced using row_ function variants.
  • rnorm() was used to generate input matrices.
  • Inputs didn't have any special cases (no NA, no Inf, no missing groups, etc).
  • For tests that had a group parameter all columns were divided into 5 equal groups.
  • For base functions tests were performed on each row of a matrix using a for loop.
  • Running times were calculated using system.time() function.
  • Each test was ran 5 times and the median time was used as a run time estimate.

Notes

  1. Since all the benchmarks were done on "normal" matrices with no missing values - running times may change if missing values are present. For now such cases are not included in the benchmark. Additional benchmarks will be considered if big running time discrepancies are noted in case of NA values, ties, or other special scenarios.

  2. base version tests do not do any post-processing, like arranging the results in a data.frame or extracting of p-values. In such cases the running times for base tests might increase a bit further.

Code

In order to run the benchmarks or inspect the code do the following:

# path for the benchmark code files
path <- system.file("benchmarks", package = "matrixTests")
# all implemented benchmarks
files <- list.files(path, pattern="\\.R$", full.names=TRUE)
# run the test file (NOTE: this will print times and generate a png file)
source(files[1], chdir=TRUE)

Alternatively - inspect the source files. Parameters that can be adjusted:

  • number of rows
  • number of columns
  • number of times each test will be executed

Results

row_bartlett

row_bartlett

row_brownforsythe

row_brownforsythe

row_cor_pearson

row_cor_pearson

row_f_var

row_f_var

row_flignerkilleen

row_flignerkilleen

row_jarquebera

row_jarquebera

row_kruskalwallis

row_kruskalwallis

row_oneway_equalvar

row_oneway_equalvar

row_oneway_welch

row_oneway_welch

row_t_equalvar

row_t_equalvar

row_t_onesample

row_t_onesample

row_t_paired

row_t_paired

row_t_welch

row_t_welch

row_waerden

row_waerden

row_wilcoxon_onesample

row_wilcoxon_onesample

row_wilcoxon_paired

row_wilcoxon_paired

row_wilcoxon_twosample

row_wilcoxon_twosample