1<%@include file="includes/setup.md.rsp"%> 2 3<%@string colname="colQuantiles"%> 4<%@string rowname="rowQuantiles"%> 5<%@string fcnname="colRowQuantiles_subset"%> 6<%@meta title="${colname}() and ${rowname}() benchmarks on subsetted computation"%> 7<%@meta author="Dongcan Jiang"%> 8<%@meta date="2015-06-07"%> 9 10<%@include file="${header}"%> 11 12 13# <%@meta name="title"%> 14 15This report benchmark the performance of <%=colname%>() and <%=rowname%>() on subsetted computation. 16 17 18## Data 19```r 20<%=withCapture({ 21<%@include file="R/random-matrices.R"%> 22data <- rmatrices(mode = "double") 23})%> 24``` 25 26## Results 27 28<% for (dataLabel in names(data)) { %> 29<% message(dataLabel) %> 30### <%=dataLabel%> matrix 31 32 33```r 34<%=withCapture({ 35X <- data[[.dataLabel.]] 36rows <- sample.int(nrow(X), size = nrow(X)*0.7) 37cols <- sample.int(ncol(X), size = ncol(X)*0.7) 38X_S <- X[rows, cols] 39gc() 40 41probs <- seq(from = 0, to = 1, by = 0.25) 42 43colStats <- microbenchmark( 44 "colQuantiles_X_S" = colQuantiles(X_S, probs = probs, na.rm = FALSE), 45 "colQuantiles(X, rows, cols)" = colQuantiles(X, rows = rows, cols = cols, probs = probs, na.rm = FALSE), 46 "colQuantiles(X[rows, cols])" = colQuantiles(X[rows, cols], probs = probs, na.rm = FALSE), 47 unit = "ms" 48) 49 50X <- t(X) 51X_S <- t(X_S) 52gc() 53 54rowStats <- microbenchmark( 55 "rowQuantiles_X_S" = rowQuantiles(X_S, probs = probs, na.rm = FALSE), 56 "rowQuantiles(X, cols, rows)" = rowQuantiles(X, rows = cols, cols = rows, probs = probs, na.rm = FALSE), 57 "rowQuantiles(X[cols, rows])" = rowQuantiles(X[cols, rows], probs = probs, na.rm = FALSE), 58 unit = "ms" 59) 60})%> 61``` 62 63<% crBenchmarkResults(colStats, rowStats, tags=dataLabel) %> 64 65<% } # for (dataLabel ...) %> 66 67 68<%@include file="${footer}"%> 69 70 71<%--------------------------------------------------------------------------- 72HISTORY: 732015-06-07 74o Created. 75---------------------------------------------------------------------------%> 76