Last Updated: 20th Jan 2026
A prototype support infrastructure for performance tests is being evaluated with integration into dsBase and dsBaseClient (v6.2.5+). This support is coded in R, and located in the directory tests/testthat/perffiles and tests/testthat/perftests.
Below is an example of a performance test (testthat) for the operation ds.assign. The testthat scripts file names which contain test performance, generally include “_perf_".
# context("ds.assign::perf::0")
test_that("performance", {
.durationSec <- 30 # seconds
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
ds.assign("D$LAB_TSC", newobj = "assign.newobj")
.count <- .count + 1
.current.time <- Sys.time()
}
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
.reference.rate <- perf.reference.rate("ds.assign::perf::0")
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
print(paste("ds.assign::perf::0 ", .current.rate, 0.5, 2.0))
perf.reference.save("ds.assign::perf::0", .current.rate, 0.5, 2.0)
} else {
print(paste("ds.assign::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
}
.reference.rate <- perf.reference.rate("ds.assign::perf::0")
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.assign::perf::0")
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.assign::perf::0")
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
})
Contains the R script perf_rate.R, which provides the public methods:
The performance profile are CVS files, the rows for each test
The performance profile file selected for used depends on if client or server tests.
armadillo_azure-pipeline_perf-profile.csv
armadillo_hp-laptop-quay_perf-profile.csv
dslite_hp-laptop-quay_perf-profile.csv
opal_azure-pipeline_perf-profile.csv
opal_default_perf-profile.csv
opal_hp-laptop-quay_perf-profile.csv
template_perf-profile.csv
unknown_default_perf-profile.csv
| refer_name | rate | lower_tolerance | upper_tolerance |
|---|---|---|---|
| conndisconn::perf::simple0 | 0.2725 | 0.5 | 2 |
| ds.abs::perf::0 | 2.677 | 0.5 | 2 |
| ds.asInteger::perf:0 | 2.294 | 0.5 | 2 |
| ds.asList::perf:0 | 4.587 | 0.5 | 2 |
| ds.asNumeric::perf:0 | 2.185 | 0.5 | 2 |
| ds.assign::perf::0 | 5.490 | 0.5 | 2 |
| ds.class::perf::combine:0 | 4.760 | 0.5 | 2 |
| ds.colnames::perf:0 | 9.079 | 0.5 | 2 |
| ds.exists::perf::combine:0 | 11.09 | 0.5 | 2 |
| ds.length::perf::combine:0 | 9.479 | 0.5 | 2 |
| ds.mean::perf::combine:0 | 9.650 | 0.5 | 2 |
| ds.mean::perf::split:0 | 11.26 | 0.5 | 2 |
| void::perf::void::0 | 46250.0 | 0.5 | 2 |