2025-01-12 00:52:51 +08:00

69 lines
1.2 KiB
Plaintext

<%@include file="includes/setup.md.rsp"%>
<%@string colname="colTabulates"%>
<%@string rowname="rowTabulates"%>
<%@meta title="${colname}() and ${rowname}() benchmarks"%>
<%@meta author="Henrik Bengtsson"%>
<%@meta date="2014-06-09"%>
<%@include file="${header}"%>
# <%@meta name="title"%>
This report benchmark the performance of <%=colname%>() and <%=rowname%>() against alternative methods.
## Alternative methods
* ???
## Data
```r
<%=withCapture({
<%@include file="R/random-matrices.R"%>
data <- rmatrices(mode = "integer", range = c(-10, 10))
})%>
```
## Results
<% for (dataLabel in names(data)) { %>
<% message(dataLabel) %>
### <%=dataLabel%> matrix
```r
<%=withCapture({
X <- data[[.dataLabel.]]
gc()
colStats <- microbenchmark(
colTabulates = colTabulates(X, na.rm = FALSE),
unit = "ms"
)
X <- t(X)
gc()
rowStats <- microbenchmark(
rowTabulates = rowTabulates(X, na.rm = FALSE),
unit = "ms"
)
})%>
```
<% crBenchmarkResults(colStats, rowStats, tags=dataLabel) %>
<% } # for (dataLabel ...) %>
<%@include file="${footer}"%>
<%---------------------------------------------------------------------------
HISTORY:
2014-06-09
o Created.
---------------------------------------------------------------------------%>