-
Notifications
You must be signed in to change notification settings - Fork 0
meanOver
matrixStats: Benchmark report
This report benchmark the performance of meanOver() against alternative methods.
- mean() + [()
- mean.default() + [() - avoids method dispatching
as below
> meanOver_R_v1 <- function(x, na.rm = FALSE, idxs) {
+ mean(x[idxs], na.rm = na.rm)
+ }and
> meanOver_R_v2 <- function(x, na.rm = FALSE, idxs) {
+ mean.default(x[idxs], na.rm = na.rm)
+ }> rvector <- function(n, mode = c("logical", "double", "integer"), range = c(-100, +100), naProb = 0) {
+ mode <- match.arg(mode)
+ if (mode == "logical") {
+ X <- sample(c(FALSE, TRUE), size = n, replace = TRUE)
+ } else {
+ x <- runif(n, min = range[1], max = range[2])
+ }
+ storage.mode(x) <- mode
+ if (naProb > 0)
+ x[sample(n, size = naProb * n)] <- NA
+ x
+ }
> rvectors <- function(scale = 10, seed = 1, ...) {
+ set.seed(seed)
+ data <- list()
+ data[[1]] <- rvector(n = scale * 100, ...)
+ data[[2]] <- rvector(n = scale * 1000, ...)
+ data[[3]] <- rvector(n = scale * 10000, ...)
+ data[[4]] <- rvector(n = scale * 1e+05, ...)
+ data[[5]] <- rvector(n = scale * 1e+06, ...)
+ names(data) <- sprintf("n=%d", sapply(data, FUN = length))
+ data
+ }
> data <- rvectors(mode = mode)> x <- data[["n=1000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755108 93.8 2637877 140.9 2637877 140.9
Vcells 18338081 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 0.0042 | 0.0046 | 0.0052 | 0.0050 | 0.0054 | 0.0181 |
| 1 | meanOver | 0.0058 | 0.0065 | 0.0111 | 0.0069 | 0.0077 | 0.3083 |
| 2 | meanOver_no_refine | 0.0058 | 0.0065 | 0.0075 | 0.0069 | 0.0075 | 0.0281 |
| 3 | mean | 0.0119 | 0.0135 | 0.0172 | 0.0142 | 0.0152 | 0.0789 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.364 | 1.417 | 2.109 | 1.385 | 1.429 | 17.042 |
| 2 | meanOver_no_refine | 1.364 | 1.417 | 1.431 | 1.385 | 1.393 | 1.553 |
| 3 | mean | 2.818 | 2.916 | 3.275 | 2.846 | 2.821 | 4.362 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755368 93.8 2637877 140.9 2637877 140.9
Vcells 18339882 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 0.0046 | 0.0062 | 0.0083 | 0.0069 | 0.0081 | 0.1036 |
| 2 | meanOver_no_refine | 0.0046 | 0.0064 | 0.0085 | 0.0077 | 0.0089 | 0.0689 |
| 4 | mean.default+[() | 0.0085 | 0.0100 | 0.0134 | 0.0112 | 0.0123 | 0.0731 |
| 3 | mean+[() | 0.0185 | 0.0216 | 0.0256 | 0.0243 | 0.0266 | 0.0778 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 2 | meanOver_no_refine | 1.000 | 1.031 | 1.027 | 1.111 | 1.095 | 0.6654 |
| 4 | mean.default+[() | 1.833 | 1.625 | 1.613 | 1.611 | 1.524 | 0.7063 |
| 3 | mean+[() | 4.000 | 3.500 | 3.081 | 3.500 | 3.285 | 0.7509 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755383 93.8 2637877 140.9 2637877 140.9
Vcells 18340510 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0050 | 0.0065 | 0.0073 | 0.0069 | 0.0079 | 0.0135 |
| 1 | meanOver | 0.0046 | 0.0065 | 0.0075 | 0.0073 | 0.0081 | 0.0289 |
| 4 | mean.default+[() | 0.0104 | 0.0123 | 0.0141 | 0.0127 | 0.0135 | 0.0724 |
| 3 | mean+[() | 0.0212 | 0.0227 | 0.0249 | 0.0239 | 0.0250 | 0.0712 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 0.9231 | 1.000 | 1.028 | 1.056 | 1.024 | 2.143 |
| 4 | mean.default+[() | 2.0769 | 1.882 | 1.927 | 1.833 | 1.707 | 5.371 |
| 3 | mean+[() | 4.2304 | 3.470 | 3.399 | 3.444 | 3.170 | 5.285 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755395 93.8 2637877 140.9 2637877 140.9
Vcells 18340718 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0065 | 0.0077 | 0.0087 | 0.0085 | 0.0092 | 0.0289 |
| 1 | meanOver | 0.0065 | 0.0077 | 0.0089 | 0.0085 | 0.0092 | 0.0254 |
| 4 | mean.default+[() | 0.0154 | 0.0169 | 0.0189 | 0.0177 | 0.0187 | 0.0724 |
| 3 | mean+[() | 0.0239 | 0.0281 | 0.0300 | 0.0289 | 0.0308 | 0.0724 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.00 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.000 | 1.00 | 1.023 | 1.000 | 1.000 | 0.880 |
| 4 | mean.default+[() | 2.353 | 2.20 | 2.181 | 2.091 | 2.021 | 2.507 |
| 3 | mean+[() | 3.647 | 3.65 | 3.456 | 3.409 | 3.333 | 2.507 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755342 93.8 2637877 140.9 2637877 140.9
Vcells 18340463 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 0.0108 | 0.0116 | 0.0156 | 0.0119 | 0.0214 | 0.0504 |
| 1 | meanOver | 0.0150 | 0.0158 | 0.0195 | 0.0166 | 0.0243 | 0.0543 |
| 2 | meanOver_no_refine | 0.0150 | 0.0162 | 0.0190 | 0.0166 | 0.0243 | 0.0269 |
| 3 | mean | 0.0166 | 0.0177 | 0.0236 | 0.0185 | 0.0308 | 0.1436 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 1 | meanOver | 1.393 | 1.367 | 1.252 | 1.387 | 1.135 | 1.0763 |
| 2 | meanOver_no_refine | 1.393 | 1.400 | 1.217 | 1.387 | 1.135 | 0.5344 |
| 3 | mean | 1.536 | 1.533 | 1.514 | 1.548 | 1.441 | 2.8473 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755419 93.8 2637877 140.9 2637877 140.9
Vcells 18341794 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 0.0062 | 0.0081 | 0.0115 | 0.0116 | 0.0135 | 0.0316 |
| 2 | meanOver_no_refine | 0.0065 | 0.0085 | 0.0128 | 0.0127 | 0.0146 | 0.0493 |
| 4 | mean.default+[() | 0.0177 | 0.0283 | 0.0383 | 0.0335 | 0.0354 | 0.4947 |
| 3 | mean+[() | 0.0258 | 0.0316 | 0.0636 | 0.0456 | 0.0485 | 1.5518 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.000 | 1.000 | 1.000 | 1.00 | 1.000 | 1.000 |
| 2 | meanOver_no_refine | 1.062 | 1.048 | 1.107 | 1.10 | 1.086 | 1.561 |
| 4 | mean.default+[() | 2.875 | 3.500 | 3.317 | 2.90 | 2.628 | 15.670 |
| 3 | mean+[() | 4.187 | 3.904 | 5.507 | 3.95 | 3.600 | 49.157 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755431 93.8 2637877 140.9 2637877 140.9
Vcells 18343105 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0092 | 0.0108 | 0.0517 | 0.0115 | 0.0127 | 3.8580 |
| 1 | meanOver | 0.0096 | 0.0108 | 0.0133 | 0.0116 | 0.0131 | 0.0674 |
| 4 | mean.default+[() | 0.0320 | 0.0331 | 0.0372 | 0.0339 | 0.0350 | 0.1216 |
| 3 | mean+[() | 0.0397 | 0.0416 | 0.0505 | 0.0427 | 0.0443 | 0.2244 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.0000 | 1.000 | 1.000 | 1.0000 |
| 1 | meanOver | 1.042 | 1.000 | 0.2580 | 1.000 | 1.030 | 0.0175 |
| 4 | mean.default+[() | 3.458 | 3.071 | 0.7207 | 2.933 | 2.758 | 0.0315 |
| 3 | mean+[() | 4.291 | 3.857 | 0.9766 | 3.700 | 3.485 | 0.0582 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755443 93.8 2637877 140.9 2637877 140.9
Vcells 18345477 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0162 | 0.0189 | 0.0262 | 0.0273 | 0.0316 | 0.0427 |
| 1 | meanOver | 0.0158 | 0.0198 | 0.0266 | 0.0279 | 0.0325 | 0.0427 |
| 4 | mean.default+[() | 0.0604 | 0.0637 | 0.0929 | 0.1039 | 0.1153 | 0.1574 |
| 3 | mean+[() | 0.0701 | 0.0728 | 0.1014 | 0.1072 | 0.1257 | 0.2156 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 0.9762 | 1.051 | 1.017 | 1.021 | 1.030 | 1.000 |
| 4 | mean.default+[() | 3.7379 | 3.377 | 3.547 | 3.803 | 3.652 | 3.685 |
| 3 | mean+[() | 4.3332 | 3.857 | 3.871 | 3.922 | 3.982 | 5.045 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755390 93.8 2637877 140.9 2637877 140.9
Vcells 18345009 140.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=100000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 0.1024 | 0.1419 | 0.1695 | 0.1777 | 0.1952 | 0.5736 |
| 2 | meanOver_no_refine | 0.1363 | 0.1807 | 0.2007 | 0.2048 | 0.2181 | 0.3376 |
| 1 | meanOver | 0.1359 | 0.1804 | 0.1985 | 0.2048 | 0.2188 | 0.3149 |
| 3 | mean | 0.1113 | 0.1671 | 0.1884 | 0.2052 | 0.2146 | 0.2960 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 2 | meanOver_no_refine | 1.331 | 1.274 | 1.184 | 1.153 | 1.117 | 0.5886 |
| 1 | meanOver | 1.327 | 1.271 | 1.171 | 1.153 | 1.121 | 0.5490 |
| 3 | mean | 1.087 | 1.178 | 1.111 | 1.155 | 1.100 | 0.5161 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=100000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755467 93.8 2637877 140.9 2637877 140.9
Vcells 18351928 140.1 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max |
|---|---|---|---|---|---|---|
| meanOver | 0.0408 | 0.0458 | 0.0584 | 0.0535 | 0.0708 | 0.0997 |
| meanOver_no_refine | 0.0404 | 0.0458 | 0.0602 | 0.0599 | 0.0724 | 0.1213 |
| mean+[() | 0.1605 | 0.1680 | 0.2210 | 0.1971 | 0.2702 | 0.3141 |
| mean.default+[() | 0.1494 | 0.1536 | 0.2129 | 0.2254 | 0.2529 | 0.6625 |
| expr | min | lq | mean | median | uq | max |
|---|---|---|---|---|---|---|
| meanOver | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| meanOver_no_refine | 0.9906 | 1.000 | 1.030 | 1.119 | 1.022 | 1.216 |
| mean+[() | 3.9339 | 3.668 | 3.783 | 3.683 | 3.815 | 3.151 |
| mean.default+[() | 3.6603 | 3.353 | 3.644 | 4.212 | 3.571 | 6.645 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | ||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755479 93.8 2637877 140.9 2637877 140.9
Vcells 18361936 140.1 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 0.1116 | 0.1265 | 0.1393 | 0.1315 | 0.1432 | 0.2845 |
| 2 | meanOver_no_refine | 0.1093 | 0.1278 | 0.1559 | 0.1322 | 0.1444 | 0.8923 |
| 4 | mean.default+[() | 0.3961 | 0.4929 | 0.5282 | 0.4997 | 0.5174 | 1.3185 |
| 3 | mean+[() | 0.4820 | 0.5251 | 0.5558 | 0.5420 | 0.5605 | 0.7707 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 2 | meanOver_no_refine | 0.9793 | 1.011 | 1.119 | 1.006 | 1.008 | 3.137 |
| 4 | mean.default+[() | 3.5483 | 3.898 | 3.792 | 3.801 | 3.613 | 4.635 |
| 3 | mean+[() | 4.3172 | 4.152 | 3.990 | 4.123 | 3.914 | 2.709 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755491 93.8 2637877 140.9 2637877 140.9
Vcells 18382471 140.3 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 0.1405 | 0.1592 | 0.2278 | 0.1798 | 0.2816 | 0.5320 |
| 2 | meanOver_no_refine | 0.1386 | 0.1603 | 0.2157 | 0.1809 | 0.2668 | 0.6683 |
| 4 | mean.default+[() | 0.6017 | 0.6198 | 0.8459 | 0.7023 | 1.0120 | 2.7547 |
| 3 | mean+[() | 0.6202 | 0.6513 | 0.8479 | 0.7172 | 1.0742 | 1.5279 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.0000 | 1.000 | 1.0000 | 1.000 | 1.0000 | 1.000 |
| 2 | meanOver_no_refine | 0.9863 | 1.007 | 0.9469 | 1.006 | 0.9474 | 1.256 |
| 4 | mean.default+[() | 4.2822 | 3.894 | 3.7139 | 3.907 | 3.5940 | 5.178 |
| 3 | mean+[() | 4.4137 | 4.092 | 3.7229 | 3.989 | 3.8147 | 2.872 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=100000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755439 93.8 2637877 140.9 2637877 140.9
Vcells 18382011 140.3 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.183 | 1.262 | 1.851 | 2.019 | 2.113 | 6.343 |
| 3 | mean | 1.226 | 1.647 | 1.922 | 2.056 | 2.156 | 3.263 |
| 2 | meanOver_no_refine | 1.496 | 1.600 | 2.176 | 2.196 | 2.421 | 4.950 |
| 1 | meanOver | 1.501 | 1.811 | 2.146 | 2.210 | 2.445 | 3.594 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 3 | mean | 1.037 | 1.304 | 1.038 | 1.019 | 1.020 | 0.5144 |
| 2 | meanOver_no_refine | 1.264 | 1.268 | 1.176 | 1.088 | 1.146 | 0.7805 |
| 1 | meanOver | 1.268 | 1.435 | 1.160 | 1.095 | 1.157 | 0.5666 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755516 93.8 2637877 140.9 2637877 140.9
Vcells 18443126 140.8 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.8946 | 1.097 | 1.298 | 1.191 | 1.294 | 3.228 |
| 1 | meanOver | 0.8176 | 1.068 | 1.254 | 1.195 | 1.279 | 3.391 |
| 4 | mean.default+[() | 2.0175 | 2.953 | 3.710 | 3.281 | 4.158 | 17.903 |
| 3 | mean+[() | 2.0418 | 3.133 | 3.712 | 3.471 | 4.202 | 9.454 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.0000 | 1.0000 | 1.0000 | 1.000 | 1.0000 | 1.000 |
| 1 | meanOver | 0.9139 | 0.9733 | 0.9662 | 1.003 | 0.9885 | 1.051 |
| 4 | mean.default+[() | 2.2552 | 2.6917 | 2.8579 | 2.755 | 3.2139 | 5.547 |
| 3 | mean+[() | 2.2823 | 2.8559 | 2.8590 | 2.915 | 3.2480 | 2.929 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755528 93.8 2637877 140.9 2637877 140.9
Vcells 18543134 141.5 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.048 | 1.404 | 1.616 | 1.562 | 1.753 | 4.473 |
| 2 | meanOver_no_refine | 1.059 | 1.377 | 1.649 | 1.594 | 1.768 | 4.703 |
| 4 | mean.default+[() | 3.602 | 5.168 | 6.149 | 5.928 | 6.573 | 22.382 |
| 3 | mean+[() | 3.592 | 5.265 | 6.269 | 6.066 | 6.901 | 22.139 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.000 | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 2 | meanOver_no_refine | 1.011 | 0.9807 | 1.021 | 1.020 | 1.008 | 1.051 |
| 4 | mean.default+[() | 3.439 | 3.6805 | 3.806 | 3.794 | 3.749 | 5.003 |
| 3 | mean+[() | 3.429 | 3.7498 | 3.880 | 3.882 | 3.936 | 4.949 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755540 93.8 2637877 140.9 2637877 140.9
Vcells 18743142 143.0 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.811 | 2.399 | 2.848 | 2.705 | 3.081 | 7.971 |
| 1 | meanOver | 1.775 | 2.502 | 2.873 | 2.765 | 3.112 | 7.638 |
| 4 | mean.default+[() | 7.361 | 10.995 | 13.259 | 12.238 | 13.915 | 45.206 |
| 3 | mean+[() | 8.352 | 11.258 | 13.512 | 12.358 | 13.764 | 32.473 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 1 | meanOver | 0.9798 | 1.043 | 1.009 | 1.022 | 1.010 | 0.9582 |
| 4 | mean.default+[() | 4.0642 | 4.582 | 4.656 | 4.524 | 4.517 | 5.6711 |
| 3 | mean+[() | 4.6115 | 4.692 | 4.744 | 4.568 | 4.468 | 4.0737 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=1000000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755487 93.8 2637877 140.9 2637877 140.9
Vcells 18743428 143.1 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 3 | mean | 11.66 | 13.64 | 16.53 | 16.70 | 19.04 | 29.00 |
| 4 | mean.default | 11.59 | 14.79 | 18.01 | 18.03 | 20.26 | 71.44 |
| 1 | meanOver | 14.62 | 16.80 | 20.21 | 19.92 | 22.71 | 46.23 |
| 2 | meanOver_no_refine | 14.61 | 17.62 | 20.35 | 20.29 | 21.61 | 62.55 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 3 | mean | 1.0000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 4 | mean.default | 0.9936 | 1.085 | 1.090 | 1.079 | 1.064 | 2.464 |
| 1 | meanOver | 1.2532 | 1.232 | 1.223 | 1.193 | 1.193 | 1.595 |
| 2 | meanOver_no_refine | 1.2524 | 1.292 | 1.232 | 1.215 | 1.135 | 2.157 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755564 93.8 2637877 140.9 2637877 140.9
Vcells 19343912 147.6 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 8.242 | 9.584 | 10.30 | 10.44 | 10.99 | 18.00 |
| 1 | meanOver | 8.308 | 9.909 | 10.53 | 10.57 | 11.13 | 13.65 |
| 4 | mean.default+[() | 25.131 | 30.762 | 37.96 | 33.80 | 36.23 | 361.61 |
| 3 | mean+[() | 24.721 | 30.790 | 35.30 | 33.84 | 36.27 | 56.97 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 1 | meanOver | 1.008 | 1.034 | 1.022 | 1.012 | 1.012 | 0.7581 |
| 4 | mean.default+[() | 3.049 | 3.210 | 3.685 | 3.237 | 3.296 | 20.0854 |
| 3 | mean+[() | 2.999 | 3.212 | 3.427 | 3.241 | 3.300 | 3.1644 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755576 93.8 2637877 140.9 2637877 140.9
Vcells 20343920 155.3 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 10.48 | 13.91 | 14.71 | 14.69 | 15.92 | 21.39 |
| 2 | meanOver_no_refine | 10.60 | 13.40 | 14.69 | 14.70 | 16.47 | 19.79 |
| 4 | mean.default+[() | 44.24 | 58.43 | 68.27 | 64.11 | 70.99 | 392.93 |
| 3 | mean+[() | 43.35 | 58.82 | 68.62 | 64.34 | 73.51 | 348.81 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 1 | meanOver | 1.000 | 1.0000 | 1.0000 | 1.000 | 1.000 | 1.0000 |
| 2 | meanOver_no_refine | 1.012 | 0.9633 | 0.9983 | 1.001 | 1.034 | 0.9251 |
| 4 | mean.default+[() | 4.222 | 4.2008 | 4.6408 | 4.364 | 4.459 | 18.3653 |
| 3 | mean+[() | 4.137 | 4.2286 | 4.6646 | 4.379 | 4.617 | 16.3036 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755588 93.8 2637877 140.9 2637877 140.9
Vcells 22344829 170.5 42812957 326.7 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 17.28 | 18.17 | 21.92 | 20.85 | 25.31 | 30.88 |
| 1 | meanOver | 17.25 | 18.22 | 21.84 | 21.46 | 25.21 | 30.55 |
| 3 | mean+[() | 81.87 | 94.19 | 117.78 | 106.58 | 123.62 | 421.72 |
| 4 | mean.default+[() | 82.26 | 96.75 | 121.88 | 115.64 | 126.60 | 428.60 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.0000 | 1.000 | 1.000 | 1.000 | 1.0000 | 1.0000 |
| 1 | meanOver | 0.9984 | 1.003 | 0.996 | 1.030 | 0.9959 | 0.9893 |
| 3 | mean+[() | 4.7369 | 5.184 | 5.372 | 5.113 | 4.8841 | 13.6561 |
| 4 | mean.default+[() | 4.7600 | 5.324 | 5.559 | 5.548 | 5.0016 | 13.8788 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on integer+n=10000000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> rvector <- function(n, mode = c("logical", "double", "integer"), range = c(-100, +100), naProb = 0) {
+ mode <- match.arg(mode)
+ if (mode == "logical") {
+ X <- sample(c(FALSE, TRUE), size = n, replace = TRUE)
+ } else {
+ x <- runif(n, min = range[1], max = range[2])
+ }
+ storage.mode(x) <- mode
+ if (naProb > 0)
+ x[sample(n, size = naProb * n)] <- NA
+ x
+ }
> rvectors <- function(scale = 10, seed = 1, ...) {
+ set.seed(seed)
+ data <- list()
+ data[[1]] <- rvector(n = scale * 100, ...)
+ data[[2]] <- rvector(n = scale * 1000, ...)
+ data[[3]] <- rvector(n = scale * 10000, ...)
+ data[[4]] <- rvector(n = scale * 1e+05, ...)
+ data[[5]] <- rvector(n = scale * 1e+06, ...)
+ names(data) <- sprintf("n=%d", sapply(data, FUN = length))
+ data
+ }
> data <- rvectors(mode = mode)> x <- data[["n=1000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755535 93.8 2637877 140.9 2637877 140.9
Vcells 27899861 212.9 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 0.0046 | 0.0054 | 0.0056 | 0.0054 | 0.0058 | 0.0065 |
| 2 | meanOver_no_refine | 0.0050 | 0.0058 | 0.0063 | 0.0062 | 0.0065 | 0.0112 |
| 1 | meanOver | 0.0062 | 0.0073 | 0.0084 | 0.0081 | 0.0085 | 0.0608 |
| 3 | mean | 0.0123 | 0.0135 | 0.0153 | 0.0146 | 0.0154 | 0.0747 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 4 | mean.default | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 2 | meanOver_no_refine | 1.083 | 1.071 | 1.122 | 1.143 | 1.133 | 1.706 |
| 1 | meanOver | 1.333 | 1.357 | 1.501 | 1.500 | 1.466 | 9.292 |
| 3 | mean | 2.667 | 2.500 | 2.725 | 2.714 | 2.666 | 11.409 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755612 93.8 2637877 140.9 2637877 140.9
Vcells 23900445 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0023 | 0.0042 | 0.0055 | 0.0058 | 0.0065 | 0.0089 |
| 1 | meanOver | 0.0031 | 0.0046 | 0.0064 | 0.0062 | 0.0071 | 0.0543 |
| 4 | mean.default+[() | 0.0054 | 0.0069 | 0.0108 | 0.0100 | 0.0108 | 0.1736 |
| 3 | mean+[() | 0.0123 | 0.0142 | 0.0192 | 0.0200 | 0.0208 | 0.0793 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.334 | 1.091 | 1.171 | 1.067 | 1.088 | 6.130 |
| 4 | mean.default+[() | 2.333 | 1.636 | 1.967 | 1.733 | 1.647 | 19.609 |
| 3 | mean+[() | 5.333 | 3.363 | 3.495 | 3.466 | 3.176 | 8.957 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755624 93.8 2637877 140.9 2637877 140.9
Vcells 23900553 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0050 | 0.0058 | 0.0065 | 0.0062 | 0.0073 | 0.0085 |
| 1 | meanOver | 0.0058 | 0.0065 | 0.0080 | 0.0075 | 0.0085 | 0.0601 |
| 4 | mean.default+[() | 0.0108 | 0.0119 | 0.0128 | 0.0127 | 0.0131 | 0.0404 |
| 3 | mean+[() | 0.0212 | 0.0231 | 0.0243 | 0.0239 | 0.0246 | 0.0712 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.154 | 1.133 | 1.240 | 1.219 | 1.158 | 7.090 |
| 4 | mean.default+[() | 2.154 | 2.066 | 1.978 | 2.062 | 1.790 | 4.772 |
| 3 | mean+[() | 4.230 | 4.000 | 3.749 | 3.874 | 3.368 | 8.408 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755636 93.8 2637877 140.9 2637877 140.9
Vcells 23901897 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0058 | 0.0067 | 0.0081 | 0.0073 | 0.0085 | 0.0635 |
| 1 | meanOver | 0.0073 | 0.0085 | 0.0092 | 0.0089 | 0.0104 | 0.0115 |
| 4 | mean.default+[() | 0.0150 | 0.0167 | 0.0177 | 0.0173 | 0.0181 | 0.0458 |
| 3 | mean+[() | 0.0262 | 0.0281 | 0.0299 | 0.0296 | 0.0308 | 0.0801 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.0000 |
| 1 | meanOver | 1.267 | 1.257 | 1.137 | 1.210 | 1.227 | 0.1818 |
| 4 | mean.default+[() | 2.600 | 2.485 | 2.192 | 2.368 | 2.136 | 0.7212 |
| 3 | mean+[() | 4.533 | 4.171 | 3.699 | 4.052 | 3.636 | 1.2606 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755583 93.8 2637877 140.9 2637877 140.9
Vcells 23901429 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0131 | 0.0179 | 0.0191 | 0.0185 | 0.0192 | 0.0697 |
| 4 | mean.default | 0.0208 | 0.0269 | 0.0274 | 0.0277 | 0.0281 | 0.0470 |
| 1 | meanOver | 0.0227 | 0.0327 | 0.0337 | 0.0339 | 0.0350 | 0.0377 |
| 3 | mean | 0.0296 | 0.0383 | 0.0397 | 0.0397 | 0.0404 | 0.0770 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.00 | 1.0000 |
| 4 | mean.default | 1.588 | 1.505 | 1.437 | 1.500 | 1.46 | 0.6740 |
| 1 | meanOver | 1.735 | 1.828 | 1.769 | 1.833 | 1.82 | 0.5414 |
| 3 | mean | 2.265 | 2.140 | 2.085 | 2.146 | 2.10 | 1.1050 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755660 93.8 2637877 140.9 2637877 140.9
Vcells 23902513 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0104 | 0.0116 | 0.0131 | 0.0131 | 0.0142 | 0.0181 |
| 1 | meanOver | 0.0158 | 0.0166 | 0.0186 | 0.0177 | 0.0191 | 0.0832 |
| 4 | mean.default+[() | 0.0343 | 0.0381 | 0.0393 | 0.0393 | 0.0404 | 0.0462 |
| 3 | mean+[() | 0.0435 | 0.0512 | 0.0528 | 0.0520 | 0.0531 | 0.1193 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.519 | 1.433 | 1.422 | 1.353 | 1.338 | 4.596 |
| 4 | mean.default+[() | 3.296 | 3.300 | 3.010 | 3.000 | 2.838 | 2.553 |
| 3 | mean+[() | 4.185 | 4.433 | 4.037 | 3.970 | 3.729 | 6.595 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755672 93.8 2637877 140.9 2637877 140.9
Vcells 23903521 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0089 | 0.0104 | 0.0135 | 0.0123 | 0.0152 | 0.0246 |
| 1 | meanOver | 0.0135 | 0.0150 | 0.0190 | 0.0169 | 0.0210 | 0.0462 |
| 4 | mean.default+[() | 0.0370 | 0.0397 | 0.0464 | 0.0416 | 0.0487 | 0.1120 |
| 3 | mean+[() | 0.0462 | 0.0504 | 0.0604 | 0.0537 | 0.0710 | 0.1001 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.522 | 1.444 | 1.408 | 1.375 | 1.380 | 1.875 |
| 4 | mean.default+[() | 4.174 | 3.814 | 3.429 | 3.375 | 3.202 | 4.547 |
| 3 | mean+[() | 5.217 | 4.851 | 4.462 | 4.359 | 4.670 | 4.062 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755684 93.8 2637877 140.9 2637877 140.9
Vcells 23906836 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0154 | 0.0164 | 0.0191 | 0.0185 | 0.0192 | 0.0450 |
| 1 | meanOver | 0.0235 | 0.0264 | 0.0284 | 0.0269 | 0.0293 | 0.0504 |
| 4 | mean.default+[() | 0.0712 | 0.0737 | 0.0759 | 0.0751 | 0.0762 | 0.1097 |
| 3 | mean+[() | 0.0808 | 0.0839 | 0.0883 | 0.0851 | 0.0874 | 0.1936 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.00 | 1.000 |
| 1 | meanOver | 1.525 | 1.612 | 1.488 | 1.458 | 1.52 | 1.120 |
| 4 | mean.default+[() | 4.625 | 4.506 | 3.983 | 4.062 | 3.96 | 2.436 |
| 3 | mean+[() | 5.250 | 5.129 | 4.633 | 4.604 | 4.54 | 4.299 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755631 93.8 2637877 140.9 2637877 140.9
Vcells 23906368 182.4 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=100000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.1036 | 0.1372 | 0.1999 | 0.2379 | 0.2444 | 0.2622 |
| 4 | mean.default | 0.2013 | 0.2514 | 0.2982 | 0.3157 | 0.3189 | 0.7853 |
| 3 | mean | 0.2541 | 0.2937 | 0.3286 | 0.3328 | 0.3540 | 0.7622 |
| 1 | meanOver | 0.2025 | 0.2847 | 0.3708 | 0.4254 | 0.4362 | 0.5917 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 4 | mean.default | 1.944 | 1.832 | 1.492 | 1.327 | 1.305 | 2.996 |
| 3 | mean | 2.454 | 2.140 | 1.644 | 1.399 | 1.448 | 2.908 |
| 1 | meanOver | 1.955 | 2.074 | 1.855 | 1.788 | 1.784 | 2.257 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=100000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755708 93.8 2637877 140.9 2637877 140.9
Vcells 23912852 182.5 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0416 | 0.0479 | 0.0614 | 0.0631 | 0.0685 | 0.0935 |
| 1 | meanOver | 0.0751 | 0.1097 | 0.1115 | 0.1126 | 0.1207 | 0.2225 |
| 4 | mean.default+[() | 0.1790 | 0.2666 | 0.2599 | 0.2737 | 0.2779 | 0.3449 |
| 3 | mean+[() | 0.1940 | 0.2868 | 0.2949 | 0.2930 | 0.3218 | 0.3761 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.806 | 2.289 | 1.815 | 1.784 | 1.761 | 2.379 |
| 4 | mean.default+[() | 4.306 | 5.562 | 4.231 | 4.335 | 4.056 | 3.687 |
| 3 | mean+[() | 4.667 | 5.984 | 4.801 | 4.640 | 4.697 | 4.021 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755720 93.8 2637877 140.9 2637877 140.9
Vcells 23922860 182.6 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.0720 | 0.0905 | 0.1131 | 0.1097 | 0.1267 | 0.2264 |
| 1 | meanOver | 0.1213 | 0.1809 | 0.1928 | 0.1929 | 0.2079 | 0.3549 |
| 4 | mean.default+[() | 0.3430 | 0.3628 | 0.4825 | 0.5079 | 0.5335 | 0.6513 |
| 3 | mean+[() | 0.3576 | 0.4970 | 0.5381 | 0.5463 | 0.5784 | 0.7399 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.685 | 2.000 | 1.705 | 1.758 | 1.641 | 1.568 |
| 4 | mean.default+[() | 4.765 | 4.011 | 4.266 | 4.630 | 4.213 | 2.878 |
| 3 | mean+[() | 4.968 | 5.494 | 4.758 | 4.979 | 4.567 | 3.269 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=100000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755732 93.8 2637877 140.9 2637877 140.9
Vcells 23942868 182.7 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 0.1444 | 0.1979 | 0.2238 | 0.2125 | 0.2371 | 0.3415 |
| 1 | meanOver | 0.2306 | 0.3563 | 0.3830 | 0.3653 | 0.4254 | 0.5401 |
| 4 | mean.default+[() | 0.7206 | 0.9990 | 1.1829 | 1.1248 | 1.4053 | 1.8043 |
| 3 | mean+[() | 0.7699 | 1.1427 | 1.2426 | 1.1760 | 1.4480 | 1.7947 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.597 | 1.801 | 1.711 | 1.719 | 1.794 | 1.582 |
| 4 | mean.default+[() | 4.992 | 5.049 | 5.286 | 5.293 | 5.926 | 5.284 |
| 3 | mean+[() | 5.333 | 5.775 | 5.552 | 5.534 | 6.106 | 5.256 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=100000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755679 93.8 2637877 140.9 2637877 140.9
Vcells 23942400 182.7 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.534 | 1.626 | 1.997 | 1.787 | 2.487 | 2.823 |
| 4 | mean.default | 2.913 | 3.011 | 3.494 | 3.458 | 4.015 | 4.730 |
| 3 | mean | 2.963 | 3.022 | 3.526 | 3.512 | 3.797 | 4.941 |
| 1 | meanOver | 3.026 | 3.114 | 3.865 | 3.682 | 4.667 | 6.525 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 4 | mean.default | 1.899 | 1.851 | 1.750 | 1.935 | 1.614 | 1.675 |
| 3 | mean | 1.931 | 1.858 | 1.765 | 1.965 | 1.526 | 1.750 |
| 1 | meanOver | 1.972 | 1.914 | 1.935 | 2.060 | 1.876 | 2.311 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=1000000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755756 93.8 2637877 140.9 2637877 140.9
Vcells 24004460 183.2 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.490 | 1.503 | 1.548 | 1.519 | 1.607 | 1.763 |
| 1 | meanOver | 2.892 | 2.910 | 3.050 | 2.970 | 3.137 | 4.390 |
| 3 | mean+[() | 3.321 | 3.415 | 3.838 | 3.846 | 3.966 | 5.386 |
| 4 | mean.default+[() | 3.248 | 3.638 | 4.238 | 3.857 | 4.267 | 23.142 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.941 | 1.935 | 1.970 | 1.955 | 1.952 | 2.490 |
| 3 | mean+[() | 2.229 | 2.271 | 2.479 | 2.532 | 2.468 | 3.055 |
| 4 | mean.default+[() | 2.179 | 2.420 | 2.738 | 2.539 | 2.655 | 13.129 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755768 93.8 2637877 140.9 2637877 140.9
Vcells 24104468 184.0 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.618 | 1.849 | 2.013 | 2.010 | 2.188 | 2.754 |
| 1 | meanOver | 3.130 | 3.244 | 3.761 | 3.679 | 4.176 | 5.046 |
| 4 | mean.default+[() | 5.147 | 6.478 | 7.745 | 7.294 | 8.102 | 26.860 |
| 3 | mean+[() | 5.175 | 6.289 | 7.461 | 7.433 | 8.063 | 26.511 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.935 | 1.754 | 1.868 | 1.831 | 1.908 | 1.832 |
| 4 | mean.default+[() | 3.182 | 3.504 | 3.847 | 3.629 | 3.703 | 9.752 |
| 3 | mean+[() | 3.199 | 3.402 | 3.706 | 3.698 | 3.685 | 9.625 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=1000000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755780 93.8 2637877 140.9 2637877 140.9
Vcells 24304476 185.5 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 2.036 | 2.439 | 2.734 | 2.525 | 3.164 | 5.757 |
| 1 | meanOver | 3.898 | 4.558 | 4.845 | 4.659 | 5.370 | 6.740 |
| 4 | mean.default+[() | 10.575 | 12.585 | 14.210 | 13.882 | 14.753 | 34.128 |
| 3 | mean+[() | 9.552 | 11.966 | 15.163 | 14.100 | 15.738 | 35.201 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.914 | 1.868 | 1.772 | 1.845 | 1.697 | 1.171 |
| 4 | mean.default+[() | 5.193 | 5.159 | 5.197 | 5.499 | 4.662 | 5.928 |
| 3 | mean+[() | 4.691 | 4.905 | 5.546 | 5.585 | 4.974 | 6.115 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=1000000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755727 93.8 2637877 140.9 2637877 140.9
Vcells 24304008 185.5 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, refine = TRUE), meanOver_no_refine = meanOver(x, refine = FALSE),
+ mean = mean(x), mean.default = mean.default(x), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000000+all data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 13.93 | 17.13 | 17.52 | 17.37 | 17.62 | 22.24 |
| 3 | mean | 26.77 | 32.68 | 33.47 | 33.19 | 33.97 | 40.75 |
| 4 | mean.default | 26.47 | 32.56 | 33.43 | 33.22 | 33.95 | 39.02 |
| 1 | meanOver | 26.87 | 34.11 | 34.84 | 34.59 | 35.44 | 42.24 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 3 | mean | 1.921 | 1.908 | 1.910 | 1.911 | 1.927 | 1.832 |
| 4 | mean.default | 1.900 | 1.901 | 1.908 | 1.913 | 1.927 | 1.755 |
| 1 | meanOver | 1.928 | 1.992 | 1.988 | 1.991 | 2.011 | 1.899 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean() and mean.default() on n=10000000+all data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.2
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755804 93.8 2637877 140.9 2637877 140.9
Vcells 24904492 190.1 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.2 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 12.09 | 14.68 | 15.10 | 14.97 | 15.54 | 20.88 |
| 1 | meanOver | 23.86 | 28.77 | 29.09 | 29.17 | 30.19 | 41.48 |
| 3 | mean+[() | 32.97 | 39.01 | 42.89 | 40.24 | 43.98 | 73.90 |
| 4 | mean.default+[() | 32.41 | 38.62 | 46.43 | 40.40 | 45.38 | 331.60 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.974 | 1.959 | 1.926 | 1.949 | 1.942 | 1.987 |
| 3 | mean+[() | 2.728 | 2.657 | 2.840 | 2.689 | 2.830 | 3.539 |
| 4 | mean.default+[() | 2.682 | 2.630 | 3.074 | 2.699 | 2.920 | 15.881 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.2 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.4
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755816 93.8 2637877 140.9 2637877 140.9
Vcells 25904500 197.7 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.4 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 14.26 | 17.32 | 18.16 | 17.77 | 18.99 | 24.91 |
| 1 | meanOver | 27.51 | 32.82 | 35.25 | 34.42 | 36.43 | 52.39 |
| 4 | mean.default+[() | 58.12 | 69.69 | 85.13 | 76.38 | 88.16 | 423.77 |
| 3 | mean+[() | 56.98 | 67.69 | 84.85 | 76.62 | 88.58 | 375.36 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.929 | 1.895 | 1.940 | 1.937 | 1.919 | 2.103 |
| 4 | mean.default+[() | 4.075 | 4.023 | 4.687 | 4.299 | 4.643 | 17.012 |
| 3 | mean+[() | 3.995 | 3.908 | 4.671 | 4.312 | 4.665 | 15.069 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.4 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
> x <- data[["n=10000000"]]
> subset
[1] 0.8
> idxs <- sort(sample(length(x), size = subset * length(x), replace = FALSE))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 1755828 93.8 2637877 140.9 2637877 140.9
Vcells 27904508 212.9 51455548 392.6 68120027 519.8
> stats <- microbenchmark(meanOver = meanOver(x, idxs = idxs, refine = TRUE), meanOver_no_refine = meanOver(x,
+ idxs = idxs, refine = FALSE), `mean+[()` = meanOver_R_v1(x, idxs = idxs), `mean.default+[()` = meanOver_R_v2(x,
+ idxs = idxs), unit = "ms")Table: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.8 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 20.40 | 22.76 | 23.74 | 23.23 | 24.16 | 31.10 |
| 1 | meanOver | 39.48 | 43.97 | 45.77 | 44.74 | 46.49 | 60.21 |
| 4 | mean.default+[() | 116.79 | 131.13 | 169.81 | 148.02 | 161.03 | 589.74 |
| 3 | mean+[() | 117.55 | 138.76 | 163.17 | 149.91 | 162.95 | 465.92 |
| expr | min | lq | mean | median | uq | max | |
|---|---|---|---|---|---|---|---|
| 2 | meanOver_no_refine | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| 1 | meanOver | 1.935 | 1.932 | 1.928 | 1.926 | 1.924 | 1.936 |
| 4 | mean.default+[() | 5.725 | 5.761 | 7.152 | 6.373 | 6.666 | 18.963 |
| 3 | mean+[() | 5.762 | 6.096 | 6.872 | 6.454 | 6.746 | 14.982 |
| Figure: Benchmarking of meanOver(), meanOver_no_refine(), mean+[()() and mean.default+[()() on double+n=10000000+0.8 data. Outliers are displayed as crosses. Times are in milliseconds. | |||||||
![]() |
R Under development (unstable) (2015-02-27 r67909)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] markdown_0.7.7 microbenchmark_1.4-2 matrixStats_0.14.0-9000
[4] ggplot2_1.0.0 knitr_1.9.3 R.devices_2.13.0
[7] R.utils_2.0.0 R.oo_1.19.0 R.methodsS3_1.7.0
loaded via a namespace (and not attached):
[1] Rcpp_0.11.4 GenomeInfoDb_1.3.13 formatR_1.0.3
[4] plyr_1.8.1 base64enc_0.1-3 tools_3.2.0
[7] digest_0.6.8 RSQLite_1.0.0 annotate_1.45.2
[10] evaluate_0.5.7 gtable_0.1.2 R.cache_0.11.1-9000
[13] lattice_0.20-30 DBI_0.3.1 parallel_3.2.0
[16] mvtnorm_1.0-2 proto_0.3-10 R.rsp_0.20.0
[19] genefilter_1.49.2 stringr_0.6.2 IRanges_2.1.41
[22] S4Vectors_0.5.21 stats4_3.2.0 grid_3.2.0
[25] Biobase_2.27.2 AnnotationDbi_1.29.17 XML_3.98-1.1
[28] survival_2.38-1 multcomp_1.3-9 TH.data_1.0-6
[31] reshape2_1.4.1 scales_0.2.4 MASS_7.3-39
[34] splines_3.2.0 BiocGenerics_0.13.6 xtable_1.8-0
[37] mime_0.2.1 colorspace_1.2-4 labeling_0.3
[40] sandwich_2.3-2 munsell_0.4.2 Cairo_1.5-6
[43] zoo_1.7-12 Total processing time was 4.16 mins.
To reproduce this report, do:
html <- matrixStats:::benchmark('meanOver')Copyright Henrik Bengtsson. Last updated on 2015-03-02 17:33:38 (-0800 UTC). Powered by RSP.
<script> var link = document.createElement('link'); link.rel = 'icon'; link.href = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAADFBMVEX9/v0AAP/9/v3//wBEQjoBAAAABHRSTlP//wD//gy7CwAAAGJJREFUOI3N0rESwCAIA9Ag///PXdoiBk0HhmbNO49DMETQCexNCSyFgdlGoO5DYOr9ThLgPosA7osIQP0sHuDOog8UI/ALa988wzdwXJRctf4s+d36YPTJ6aMd8ux3+QO4ABTtB85yDAh9AAAAAElFTkSuQmCC" document.getElementsByTagName('head')[0].appendChild(link); </script>[Benchmark reports](Benchmark reports)


































