Skip to content

Commit 232fed3

Browse files
committed
Additional 'perf' test
1 parent 5c82850 commit 232fed3

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2024 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the GNU Public License v3.0.
6+
#
7+
# You should have received a copy of the GNU General Public License
8+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
9+
#-------------------------------------------------------------------------------
10+
11+
#
12+
# Set up
13+
#
14+
15+
context("ds.asInteger::perf::setup")
16+
connect.studies.dataset.cnsim(list("GENDER"))
17+
18+
#
19+
# Tests
20+
#
21+
22+
context("ds.asInteger::perf:0")
23+
test_that("combine - performance", {
24+
.durationSec <- 30 # seconds
25+
.count <- 0
26+
.start.time <- Sys.time()
27+
.current.time <- .start.time
28+
29+
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
30+
ds.asInteger("D$GENDER", newobj = "asInteger.newobj")
31+
32+
.count <- .count + 1
33+
.current.time <- Sys.time()
34+
}
35+
expect_true(TRUE)
36+
37+
print(paste("ds.asInteger::perf::0:", format(.count / (difftime(.current.time, .start.time, units = "secs")[[1]]), digits = 8)))
38+
})
39+
40+
#
41+
# Done
42+
#
43+
44+
context("ds.asInteger::perf::shutdown")
45+
disconnect.studies.dataset.cnsim()
46+
context("ds.asInteger::perf::done")

0 commit comments

Comments
 (0)