We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbd0159 commit b7d1dabCopy full SHA for b7d1dab
tests/reg-tests-1c.R
@@ -54,9 +54,10 @@ stopifnot(!is.unsorted(NA))
54
## str(.) for large factors should be fast:
55
u <- as.character(runif(1e5))
56
dummy <- str(u); dummy <- str(u); # force compilation of str
57
-t1 <- max(0.001, system.time(str(u))[[1]]) # get a baseline > 0
+R <- 50
58
+t1 <- max(0.001, system.time(replicate(R, str(u))[[1]])) # get a baseline > 0
59
uf <- factor(u)
-(t2 <- system.time(str(uf))[[1]]) / t1 # typically around 1--2
60
+(t2 <- system.time(replicate(R, str(uf)))[[1]]) / t1 # typically around 5--10
61
stopifnot(t2 / t1 < 30)
62
## was around 600--850 for R <= 3.0.1
63
0 commit comments