63 lines
1.2 KiB
Plaintext
63 lines
1.2 KiB
Plaintext
<%@include file="includes/setup.md.rsp"%>
|
|
|
|
<%@string fcnname="logSumExp_subset"%>
|
|
<%@string subname="logSumExp"%>
|
|
<%@meta title="${subname}() benchmarks on subsetted computation"%>
|
|
<%@meta author="Dongcan Jiang"%>
|
|
<%@meta date="2015-06-07"%>
|
|
|
|
<%@include file="${header}"%>
|
|
|
|
|
|
# <%@meta name="title"%>
|
|
|
|
This report benchmark the performance of <%=subname%>() on subsetted computation.
|
|
|
|
|
|
## Data
|
|
```r
|
|
<%=withCapture({
|
|
<%@include file="R/random-vectors.R"%>
|
|
data <- rvectors(mode = "double")
|
|
data <- data[1:4]
|
|
})%>
|
|
```
|
|
|
|
## Results
|
|
|
|
<% for (ii in seq_along(data)) { %>
|
|
<%
|
|
dataLabel <- names(data)[ii]
|
|
message(dataLabel)
|
|
%>
|
|
### <%=dataLabel%> vector
|
|
|
|
```r
|
|
<%=withCapture({
|
|
x <- data[[.dataLabel.]]
|
|
idxs <- sample.int(length(x), size = length(x)*0.7)
|
|
x_S <- x[idxs]
|
|
gc()
|
|
|
|
stats <- microbenchmark(
|
|
"logSumExp_x_S" = logSumExp(x_S),
|
|
"logSumExp(x, idxs)" = logSumExp(x, idxs = idxs),
|
|
"logSumExp(x[idxs])" = logSumExp(x[idxs]),
|
|
unit = "ms"
|
|
)
|
|
})%>
|
|
```
|
|
|
|
<% benchmarkResults(stats, tags=dataLabel) %>
|
|
|
|
<% } # for (ii ...) %>
|
|
|
|
<%@include file="${footer}"%>
|
|
|
|
|
|
<%---------------------------------------------------------------------------
|
|
HISTORY:
|
|
2015-06-07
|
|
o Created.
|
|
---------------------------------------------------------------------------%>
|