Skip to content

Commit 9e216cb

Browse files
committed
Additions to 'perf' tests and profiles
1 parent eca9ae8 commit 9e216cb

17 files changed

Lines changed: 934 additions & 26 deletions
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
"refer_name","rate","lower_tolerance","upper_tolerance"
2-
"conndisconn::perf::simple0","0.1661","0.5","2"
3-
"ds.abs::perf::0","6.247","0.5","2"
4-
"ds.asInteger::perf:0","5.691","0.5","2"
5-
"ds.asList::perf:0","12.50","0.5","2"
6-
"ds.asNumeric::perf:0","5.723","0.5","2"
7-
"ds.assign::perf::0","10.52","0.5","2"
8-
"ds.class::perf::combine:0","13.73","0.5","2"
9-
"ds.colnames::perf:0","25.64","0.5","2"
10-
"ds.exists::perf::combine:0","25.73","0.5","2"
11-
"ds.length::perf::combine:0","25.44","0.5","2"
12-
"ds.mean::perf::combine:0","25.70","0.5","2"
13-
"ds.mean::perf::split:0","25.72","0.5","2"
14-
"void::perf::void::0","53016.0","0.5","2"
2+
"conndisconn::perf::simple0","0.07683","0.5","2"
3+
"ds.abs::perf::0","0 1.091","0.5","2"
4+
"ds.asCharacter::perf::0","1.389","0.5","2"
5+
"ds.asDataMatrix::perf::0","1.446","0.5","2"
6+
"ds.asInteger::perf:0","1.148","0.5","2"
7+
"ds.asList::perf:0","3.398","0.5","2"
8+
"ds.asLogical::perf::0","1.660","0.5","2"
9+
"ds.asMatrix::perf::0","1.835","0.5","2"
10+
"ds.asNumeric::perf:0","1.632","0.5","2"
11+
"ds.assign::perf::0","3.487","0.5","2"
12+
"ds.class::perf::combine:0","3.429","0.5","2"
13+
"ds.colnames::perf:0","8.219","0.5","2"
14+
"ds.completeCases::perf::combine:0","1.896",0.5","2"
15+
"ds.dim::perf::combine:0","7.748","0.5","2"
16+
"ds.exists::perf::combine:0","9.133","0.5","2"
17+
"ds.exp::perf::0","2.317","0.5","2"
18+
"ds.isNA::perf::combine:0","1.558","0.5","2"
19+
"ds.length::perf::combine:0","3.798","0.5","2"
20+
"ds.levels::perf::combine:0","3.275","0.5","2"
21+
"ds.log::perf::0","2.297","0.5","2"
22+
"ds.ls::perf::combine:0","8.168","0.5","2"
23+
"ds.mean::perf::combine:0","8.168","0.5","2"
24+
"ds.mean::perf::split:0","8.465","0.5","2"
25+
"ds.names::perf::combine:0","4.190","0.5","2"
26+
"ds.numNA::perf::combine:0","1.718","0.5","2"
27+
"ds.sqrt::perf::0","2.278","0.5","2"
28+
"ds.unique::perf::combine:0","3.909","0.5","2"
29+
"void::perf::void::0","20280.0","0.5","2"
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
"refer_name","rate","lower_tolerance","upper_tolerance"
2-
"conndisconn::perf::simple0","0.06790","0.5","2"
3-
"ds.abs::perf::0","1.998","0.5","2"
4-
"ds.asInteger::perf:0","2.111","0.5","2"
5-
"ds.asList::perf:0","4.550","0.5","2"
6-
"ds.asNumeric::perf:0","1.879","0.5","2"
7-
"ds.assign::perf::0","4.806","0.5","2"
8-
"ds.class::perf::combine:0","3.865","0.5","2"
9-
"ds.colnames::perf:0","9.577","0.5","2"
10-
"ds.exists::perf::combine:0","8.411","0.5","2"
11-
"ds.length::perf::combine:0","7.957","0.5","2"
12-
"ds.mean::perf::combine:0","9.049","0.5","2"
13-
"ds.mean::perf::split:0","9.429","0.5","2"
14-
"void::perf::void::0","21400.0","0.5","2"
2+
"conndisconn::perf::simple0","0.07683","0.5","2"
3+
"ds.abs::perf::0","0 1.091","0.5","2"
4+
"ds.asCharacter::perf::0","1.389","0.5","2"
5+
"ds.asDataMatrix::perf::0","1.446","0.5","2"
6+
"ds.asInteger::perf:0","1.148","0.5","2"
7+
"ds.asList::perf:0","3.398","0.5","2"
8+
"ds.asLogical::perf::0","1.660","0.5","2"
9+
"ds.asMatrix::perf::0","1.835","0.5","2"
10+
"ds.asNumeric::perf:0","1.632","0.5","2"
11+
"ds.assign::perf::0","3.487","0.5","2"
12+
"ds.class::perf::combine:0","3.429","0.5","2"
13+
"ds.colnames::perf:0","8.219","0.5","2"
14+
"ds.completeCases::perf::combine:0","1.896",0.5","2"
15+
"ds.dim::perf::combine:0","7.748","0.5","2"
16+
"ds.exists::perf::combine:0","9.133","0.5","2"
17+
"ds.exp::perf::0","2.317","0.5","2"
18+
"ds.isNA::perf::combine:0","1.558","0.5","2"
19+
"ds.length::perf::combine:0","3.798","0.5","2"
20+
"ds.levels::perf::combine:0","3.275","0.5","2"
21+
"ds.log::perf::0","2.297","0.5","2"
22+
"ds.ls::perf::combine:0","8.168","0.5","2"
23+
"ds.mean::perf::combine:0","8.168","0.5","2"
24+
"ds.mean::perf::split:0","8.465","0.5","2"
25+
"ds.names::perf::combine:0","4.190","0.5","2"
26+
"ds.numNA::perf::combine:0","1.718","0.5","2"
27+
"ds.sqrt::perf::0","2.278","0.5","2"
28+
"ds.unique::perf::combine:0","3.909","0.5","2"
29+
"void::perf::void::0","20280.0","0.5","2"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#-------------------------------------------------------------------------------
2+
#
3+
# This program and the accompanying materials
4+
# are made available under the terms of the GNU Public License v3.0.
5+
#
6+
# You should have received a copy of the GNU General Public License
7+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
8+
#-------------------------------------------------------------------------------
9+
10+
#
11+
# Set up
12+
#
13+
14+
# context("ds.asCharacter::perf::setup")
15+
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))
16+
17+
#
18+
# Tests
19+
#
20+
21+
# context("ds.asCharacter::perf:0")
22+
test_that("combine - performance", {
23+
.durationSec <- perf.testduration(30)
24+
.count <- 0
25+
.start.time <- Sys.time()
26+
.current.time <- .start.time
27+
28+
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
29+
ds.asCharacter("D$LAB_TSC", newobj = "perf.newobj")
30+
31+
.count <- .count + 1
32+
.current.time <- Sys.time()
33+
}
34+
35+
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
36+
.reference.rate <- perf.reference.rate("ds.asCharacter::perf::0")
37+
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
38+
print(paste("ds.asCharacter::perf::0 ", .current.rate, 0.5, 2.0))
39+
perf.reference.save("ds.asCharacter::perf::0", .current.rate, 0.5, 2.0)
40+
} else {
41+
print(paste("ds.asCharacter::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
42+
}
43+
44+
.reference.rate <- perf.reference.rate("ds.asCharacter::perf::0")
45+
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asCharacter::perf::0")
46+
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asCharacter::perf::0")
47+
48+
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
49+
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
50+
})
51+
52+
#
53+
# Done
54+
#
55+
56+
# context("ds.asCharacter::perf::shutdown")
57+
disconnect.studies.dataset.cnsim()
58+
# context("ds.asCharacter::perf::done")
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#-------------------------------------------------------------------------------
2+
#
3+
# This program and the accompanying materials
4+
# are made available under the terms of the GNU Public License v3.0.
5+
#
6+
# You should have received a copy of the GNU General Public License
7+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
8+
#-------------------------------------------------------------------------------
9+
10+
#
11+
# Set up
12+
#
13+
14+
# context("ds.asDataMatrix::perf::setup")
15+
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))
16+
17+
#
18+
# Tests
19+
#
20+
21+
# context("ds.asDataMatrix::perf:0")
22+
test_that("combine - performance", {
23+
.durationSec <- perf.testduration(30)
24+
.count <- 0
25+
.start.time <- Sys.time()
26+
.current.time <- .start.time
27+
28+
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
29+
ds.asDataMatrix(x.name = "D", newobj = "perf.newobj")
30+
31+
.count <- .count + 1
32+
.current.time <- Sys.time()
33+
}
34+
35+
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
36+
.reference.rate <- perf.reference.rate("ds.asDataMatrix::perf::0")
37+
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
38+
print(paste("ds.asDataMatrix::perf::0 ", .current.rate, 0.5, 2.0))
39+
perf.reference.save("ds.asDataMatrix::perf::0", .current.rate, 0.5, 2.0)
40+
} else {
41+
print(paste("ds.asDataMatrix::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
42+
}
43+
44+
.reference.rate <- perf.reference.rate("ds.asDataMatrix::perf::0")
45+
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asDataMatrix::perf::0")
46+
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asDataMatrix::perf::0")
47+
48+
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
49+
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
50+
})
51+
52+
#
53+
# Done
54+
#
55+
56+
# context("ds.asDataMatrix::perf::shutdown")
57+
disconnect.studies.dataset.cnsim()
58+
# context("ds.asDataMatrix::perf::done")
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#-------------------------------------------------------------------------------
2+
#
3+
# This program and the accompanying materials
4+
# are made available under the terms of the GNU Public License v3.0.
5+
#
6+
# You should have received a copy of the GNU General Public License
7+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
8+
#-------------------------------------------------------------------------------
9+
10+
#
11+
# Set up
12+
#
13+
14+
# context("ds.asLogical::perf::setup")
15+
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))
16+
17+
#
18+
# Tests
19+
#
20+
21+
# context("ds.asLogical::perf:0")
22+
test_that("combine - performance", {
23+
.durationSec <- perf.testduration(30)
24+
.count <- 0
25+
.start.time <- Sys.time()
26+
.current.time <- .start.time
27+
28+
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
29+
ds.asLogical("D$LAB_TSC", newobj = "perf.newobj")
30+
31+
.count <- .count + 1
32+
.current.time <- Sys.time()
33+
}
34+
35+
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
36+
.reference.rate <- perf.reference.rate("ds.asLogical::perf::0")
37+
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
38+
print(paste("ds.asLogical::perf::0 ", .current.rate, 0.5, 2.0))
39+
perf.reference.save("ds.asLogical::perf::0", .current.rate, 0.5, 2.0)
40+
} else {
41+
print(paste("ds.asLogical::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
42+
}
43+
44+
.reference.rate <- perf.reference.rate("ds.asLogical::perf::0")
45+
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asLogical::perf::0")
46+
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asLogical::perf::0")
47+
48+
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
49+
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
50+
})
51+
52+
#
53+
# Done
54+
#
55+
56+
# context("ds.asLogical::perf::shutdown")
57+
disconnect.studies.dataset.cnsim()
58+
# context("ds.asLogical::perf::done")
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#-------------------------------------------------------------------------------
2+
#
3+
# This program and the accompanying materials
4+
# are made available under the terms of the GNU Public License v3.0.
5+
#
6+
# You should have received a copy of the GNU General Public License
7+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
8+
#-------------------------------------------------------------------------------
9+
10+
#
11+
# Set up
12+
#
13+
14+
# context("ds.asMatrix::perf::setup")
15+
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))
16+
17+
#
18+
# Tests
19+
#
20+
21+
# context("ds.asMatrix::perf:0")
22+
test_that("combine - performance", {
23+
.durationSec <- perf.testduration(30)
24+
.count <- 0
25+
.start.time <- Sys.time()
26+
.current.time <- .start.time
27+
28+
while (difftime(.current.time, .start.time, units = "secs")[[1]] < .durationSec) {
29+
ds.asMatrix(x.name = "D$LAB_TSC", newobj = "perf.newobj")
30+
31+
.count <- .count + 1
32+
.current.time <- Sys.time()
33+
}
34+
35+
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
36+
.reference.rate <- perf.reference.rate("ds.asMatrix::perf::0")
37+
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
38+
print(paste("ds.asMatrix::perf::0 ", .current.rate, 0.5, 2.0))
39+
perf.reference.save("ds.asMatrix::perf::0", .current.rate, 0.5, 2.0)
40+
} else {
41+
print(paste("ds.asMatrix::perf::0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
42+
}
43+
44+
.reference.rate <- perf.reference.rate("ds.asMatrix::perf::0")
45+
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.asMatrix::perf::0")
46+
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.asMatrix::perf::0")
47+
48+
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
49+
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
50+
})
51+
52+
#
53+
# Done
54+
#
55+
56+
# context("ds.asMatrix::perf::shutdown")
57+
disconnect.studies.dataset.cnsim()
58+
# context("ds.asMatrix::perf::done")
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2024-2025 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.completeCases::perf::setup")
16+
connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG"))
17+
18+
#
19+
# Tests
20+
#
21+
22+
# context("ds.completeCases::perf::combine:0")
23+
test_that("combine - performance", {
24+
.durationSec <- perf.testduration(30)
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.completeCases("D", newobj="D_complete")
31+
32+
.count <- .count + 1
33+
.current.time <- Sys.time()
34+
}
35+
36+
.current.rate <- .count / (difftime(.current.time, .start.time, units = "secs")[[1]])
37+
.reference.rate <- perf.reference.rate("ds.completeCases::perf::combine:0")
38+
if (any(length(.reference.rate) == 0) || any(is.null(.reference.rate))) {
39+
print(paste("ds.completeCases::perf::combine:0 ", .current.rate, 0.5, 2.0))
40+
perf.reference.save("ds.completeCases::perf::combine:0", .current.rate, 0.5, 2.0)
41+
} else {
42+
print(paste("ds.completeCases::perf::combine:0 ", format(.current.rate, digits = 8), ", ", format(100.0 * .current.rate / .reference.rate, digits = 4), "%", sep = ''))
43+
}
44+
45+
.reference.rate <- perf.reference.rate("ds.completeCases::perf::combine:0")
46+
.reference.tolerance.lower <- perf.reference.tolerance.lower("ds.completeCases::perf::combine:0")
47+
.reference.tolerance.upper <- perf.reference.tolerance.upper("ds.completeCases::perf::combine:0")
48+
49+
expect_gt(.current.rate, .reference.rate * .reference.tolerance.lower, label = "Observed rate", expected.label = "lower threshold on rate")
50+
expect_lt(.current.rate, .reference.rate * .reference.tolerance.upper, label = "Observed rate", expected.label = "upper threshold on rate")
51+
})
52+
53+
#
54+
# Done
55+
#
56+
57+
# context("ds.completeCases::perf::shutdown")
58+
disconnect.studies.dataset.cnsim()
59+
# context("ds.completeCases::perf::done")

0 commit comments

Comments
 (0)