R Under development (unstable) (2024-03-07 r86063 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > total_time <- Sys.time() > > suppressMessages(library(Rcpp)) > suppressMessages(library(dplyr)) > suppressMessages(library(data.table)) > suppressMessages(library(qs)) > suppressMessages(library(stringfish)) > options(warn = 1) > > do_gc <- function() { + if (utils::compareVersion(as.character(getRversion()), "3.5.0") != -1) { + gc(full = TRUE) + } else { + gc() + } + } > > # because sourceCpp uses setwd, we need absolute path to R_TESTS when run within R CMD check > R_TESTS <- Sys.getenv("R_TESTS") # startup.Rs > if (nzchar(R_TESTS)) { + R_TESTS_absolute <- normalizePath(R_TESTS) + Sys.setenv(R_TESTS = R_TESTS_absolute) + } > sourceCpp(code="#include + using namespace Rcpp; + // [[Rcpp::plugins(cpp11)]] + // [[Rcpp::export(rng=false)]] + CharacterVector splitstr(std::string x, std::vector cuts){ + CharacterVector ret(cuts.size() - 1); + for(uint64_t i=1; i list_elements){ + auto randchar = []() -> char + { + const char charset[] = + \"0123456789\" + \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \"abcdefghijklmnopqrstuvwxyz\"; + const size_t max_index = (sizeof(charset) - 1); + return charset[ rand() % max_index ]; + }; + List ret(list_elements.size()); + std::string str(10,0); + for(size_t i=0; i(rand()); + break; + } + } + return ret; + }") > if (nzchar(R_TESTS)) Sys.setenv(R_TESTS = R_TESTS) > > args <- commandArgs(T) > if (nzchar(R_TESTS) || ((length(args) > 0) && args[1] == "check")) { # do fewer tests within R CMD check so it completes within a reasonable amount of time + reps <- 2 + test_points <- c(0, 1, 2, 4, 8, 2^5 - 1, 2^5 + 1, 2^5, 2^8 - 1, 2^8 + 1, 2^8, 2^16 - 1, 2^16 + 1, 2^16, 1e6) + test_points_slow <- c(0, 1, 2, 4, 8, 2^5 - 1, 2^5 + 1, 2^5, 2^8 - 1, 2^8 + 1, 2^8, 2^16 - 1, 2^16 + 1, 2^16) # for Character Vector, stringfish and list + max_size <- 1e6 + } else { + reps <- 3 + test_points <- c(0, 1, 2, 4, 8, 2^5 - 1, 2^5 + 1, 2^5, 2^8 - 1, 2^8 + 1, 2^8, 2^16 - 1, 2^16 + 1, 2^16, 1e6, 1e7) + test_points_slow <- test_points + max_size <- 1e7 + } > myfile <- tempfile() > > obj_size <- 0 > get_obj_size <- function() { + get("obj_size", envir = globalenv()) + } > set_obj_size <- function(x) { + assign("obj_size", get_obj_size() + as.numeric(object.size(x)), envir = globalenv()) + return(get_obj_size()); + } > random_object_generator <- function(N, with_envs = FALSE) { # additional input: global obj_size, max_size + if (sample(3, 1) == 1) { + ret <- as.list(1:N) + } else if (sample(2, 1) == 1) { + ret <- as.pairlist(1:N) + } else { + ret <- as.pairlist(1:N) + setlev(ret, sample(2L^12L, 1L) - 1L) + setobj(ret, 1L) + } + + for (i in 1:N) { + if (get_obj_size() > get("max_size", envir = globalenv())) break; + otype <- sample(12, size = 1) + z <- NULL + is_attribute <- ifelse(i == 1, F, sample(c(F, T), size = 1)) + if (otype == 1) {z <- rnorm(1e4); set_obj_size(z);} + else if (otype == 2) { z <- sample(1e4) - 5e2; set_obj_size(z); } + else if (otype == 3) { z <- sample(c(T, F, NA), size = 1e4, replace = T); set_obj_size(z); } + else if (otype == 4) { z <- (sample(256, size = 1e4, replace = T) - 1) %>% as.raw; set_obj_size(z); } + else if (otype == 5) { z <- replicate(sample(1e4, size = 1), {rep(letters, length.out = sample(10, size = 1)) %>% paste(collapse = "")}); set_obj_size(z); } + else if (otype == 6) { z <- rep(letters, length.out = sample(1e4, size = 1)) %>% paste(collapse = ""); set_obj_size(z); } + else if (otype == 7) { z <- as.formula("y ~ a + b + c : d", env = globalenv()); attr(z, "blah") <- sample(1e4) - 5e2; set_obj_size(z); } + else if (with_envs && otype %in% c(8, 9)) { z <- function(x) {x + runif(1)} } + # else if(with_envs && otype %in% c(10,11)) { z <- new.env(); z$x <- random_object_generator(N, with_envs); makeActiveBinding("y", function() runif(1), z) } + else { z <- random_object_generator(N, with_envs) } + if (is_attribute) { + attr(ret[[i - 1]], runif(1) %>% as.character()) <- z + } else { + ret[[i]] <- z + } + } + return(ret) + } > > rand_strings <- function(n) { + s <- sample(0:100, size = n, replace = T) + x <- lapply(unique(s), function(si) { + stringfish::random_strings(sum(s == si), si, vector_mode = "normal") + }) %>% unlist %>% sample + x[sample(n, size = n/10)] <- NA + return(x) + } > > nested_tibble <- function() { + sub_tibble <- function(nr = 600, nc = 4) { + z <- lapply(1:nc, function(i) rand_strings(nr)) %>% + setNames(make.unique(paste0(sample(letters, nc), rand_strings(nc)))) %>% + bind_cols %>% + as_tibble + } + tibble( + col1 = rand_strings(100), + col2 = rand_strings(100), + col3 = lapply(1:100, function(i) sub_tibble(nr = 600, nc = 4)), + col4 = lapply(1:100, function(i) sub_tibble(nr = 600, nc = 4)), + col5 = lapply(1:100, function(i) sub_tibble(nr = 600, nc = 4)) + ) %>% setNames(make.unique(paste0(sample(letters, 5), rand_strings(5)))) + } > > printCarriage <- function(x) { + cat(x, "\r") + } > > attributes_serialize_identical <- function(attributes, full_object) { + identical(serialize(attributes(full_object), NULL), serialize(attributes, NULL)) + } > > attributes_identical <- function(attributes, full_object) { + identical(attributes, attributes(full_object)) + } > > ################################################################################################ > > qsave_rand <- function(x, file) { + alg <- sample(c("lz4", "zstd", "lz4hc", "zstd_stream", "uncompressed"), 1) + # alg <- "zstd_stream" + nt <- sample(5,1) + sc <- sample(0:15,1) + cl <- sample(10,1) + ch <- sample(c(T,F),1) + qsave(x, file = file, preset = "custom", algorithm = alg, + compress_level = cl, shuffle_control = sc, nthreads = nt, check_hash = ch) + } > > qattributes_rand <- function(file) { + # ar <- sample(c(T,F),1) + # don't use altrep to avoid serialization differences + # attributes_serialize_identical won't pass with ALTREP + ar <- FALSE + nt <- sample(5,1) + qattributes(file, use_alt_rep = ar, nthreads = nt, strict = T) + } > > ################################################################################################ > > for (q in 1:reps) { + cat("Rep", q, "of", reps, "\n") + # String correctness + time <- vector("numeric", length = 3) + for (tp in test_points) { + for (i in 1:3) { + x1 <- rep(letters, length.out = tp) %>% paste(collapse = "") + x1 <- c(NA, "", x1) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("strings: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # Character vectors + time <- vector("numeric", length = 3) + for (tp in test_points_slow) { + for (i in 1:3) { + # qs_use_alt_rep(F) + x1 <- rep(as.raw(sample(255)), length.out = tp*10) %>% rawToChar + cuts <- sample(tp*10, tp + 1) %>% sort %>% as.numeric + x1 <- splitstr(x1, cuts) + x1 <- c(NA, "", x1) + qsave_rand(x1, file = myfile) + time[i] <- Sys.time() + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Character Vectors: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # stringfish character vectors -- require R > 3.5.0 + if (utils::compareVersion(as.character(getRversion()), "3.5.0") != -1) { + time <- vector("numeric", length = 3) + for (tp in test_points_slow) { + for (i in 1:3) { + x1 <- rep(as.raw(sample(255)), length.out = tp*10) %>% rawToChar + cuts <- sample(tp*10, tp + 1) %>% sort %>% as.numeric + x1 <- splitstr(x1, cuts) + x1 <- c(NA, "", x1) + x1 <- stringfish::convert_to_sf(x1) + qsave_rand(x1, file = myfile) + time[i] <- Sys.time() + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Stringfish: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + } + + # Integers + time <- vector("numeric", length = 3) + for (tp in test_points) { + for (i in 1:3) { + x1 <- sample(1:tp, replace = T) + x1 <- c(NA, x1) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Integers: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # Doubles + time <- vector("numeric", length = 3) + for (tp in test_points) { + for (i in 1:3) { + x1 <- rnorm(tp) + x1 <- c(NA, x1) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Numeric: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # Logical + time <- vector("numeric", length = 3) + for (tp in test_points) { + for (i in 1:3) { + + x1 <- sample(c(T, F, NA), replace = T, size = tp) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Logical: %s, %s s",tp, signif(mean(time),4))) + } + cat("\n") + + # List + time <- vector("numeric", length = 3) + for (tp in test_points_slow) { + for (i in 1:3) { + x1 <- generateList(sample(1:4, replace = T, size = tp)) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("List: %s, %s s",tp, signif(mean(time),4))) + } + cat("\n") + + for (i in 1:3) { + x1 <- rep( replicate(1000, { rep(letters, length.out = 2^7 + sample(10, size = 1)) %>% paste(collapse = "") }), length.out = 1e6 ) + x1 <- data.frame(str = x1,num = runif(1:1000), stringsAsFactors = F) + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + do_gc() + stopifnot(attributes_identical(z, x1)) + } + cat("Data.frame test") + cat("\n") + + for (i in 1:3) { + x1 <- rep( replicate(1000, { rep(letters, length.out = 2^7 + sample(10, size = 1)) %>% paste(collapse = "") }), length.out = 1e6 ) + x1 <- data.table(str = x1,num = runif(1:1e6)) + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + do_gc() + stopifnot(attributes_serialize_identical(z, x1)) + } + cat("Data.table test") + cat("\n") + + for (i in 1:3) { + x1 <- rep( replicate(1000, { rep(letters, length.out = 2^7 + sample(10, size = 1)) %>% paste(collapse = "") }), length.out = 1e6 ) + x1 <- tibble(str = x1,num = runif(1:1e6)) + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + do_gc() + stopifnot(attributes_identical(z, x1)) + } + cat("Tibble test") + cat("\n") + + # Encoding test + if (Sys.info()[['sysname']] != "Windows") { + for (i in 1:3) { + x1 <- "己所不欲,勿施于人" # utf 8 + x2 <- x1 + Encoding(x2) <- "latin1" + x3 <- x1 + Encoding(x3) <- "bytes" + x4 <- rep(x1, x2, length.out = 1e4) %>% paste(collapse = ";") + x1 <- c(x1, x2, x3, x4) + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage("Encoding test") + } else { + printCarriage("(Encoding test not run on windows)") + } + cat("\n") + + # complex vectors + time <- vector("numeric", length = 3) + for (tp in test_points) { + for (i in 1:3) { + re <- rnorm(tp) + im <- runif(tp) + x1 <- complex(real = re, imaginary = im) + x1 <- c(NA_complex_, x1) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Complex: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # factors + for (tp in test_points) { + time <- vector("numeric", length = 3) + for (i in 1:3) { + x1 <- factor(rep(letters, length.out = tp), levels = sample(letters), ordered = TRUE) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Factors: %s, %s s",tp, signif(mean(time), 4))) + } + cat("\n") + + # Random objects + time <- vector("numeric", length = 8) + for (i in 1:8) { + # qs_use_alt_rep(sample(c(T, F), size = 1)) + obj_size <- 0 + x1 <- random_object_generator(12) + printCarriage(sprintf("Random objects: %s bytes", object.size(x1) %>% as.numeric)) + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Random objects: %s s", signif(mean(time), 4))) + cat("\n") + + # nested attributes + time <- vector("numeric", length = 3) + for (i in 1:3) { + x1 <- as.list(1:26) + attr(x1[[26]], letters[26]) <- rnorm(100) + for (i in 25:1) { + attr(x1[[i]], letters[i]) <- x1[[i + 1]] + } + time[i] <- Sys.time() + for(j in 1:length(x1)) { + qsave_rand(x1[[j]], file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1[[j]])) + } + } + printCarriage(sprintf("Nested attributes: %s s", signif(mean(time), 4))) + cat("\n") + + # alt-rep -- should serialize the unpacked object + time <- vector("numeric", length = 3) + for (i in 1:3) { + x1 <- 1:max_size + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + time[i] <- Sys.time() - time[i] + do_gc() + stopifnot(attributes_identical(z, x1)) + } + printCarriage(sprintf("Alt rep integer: %s s", signif(mean(time), 4))) + cat("\n") + + + # Environment test + time <- vector("numeric", length = 3) + for (i in 1:3) { + x1 <- new.env() + x1[["a"]] <- 1:max_size + x1[["b"]] <- runif(max_size) + x1[["c"]] <- stringfish::random_strings(1e4, vector_mode = "normal") + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + stopifnot(attributes_identical(z[["a"]], x1[["a"]])) + stopifnot(attributes_identical(z[["b"]], x1[["b"]])) + stopifnot(attributes_identical(z[["c"]], x1[["c"]])) + time[i] <- Sys.time() - time[i] + do_gc() + } + printCarriage(sprintf("Environment test: %s s", signif(mean(time), 4))) + cat("\n") + + time <- vector("numeric", length = 3) + for (i in 1:3) { + x1 <- nested_tibble() + time[i] <- Sys.time() + qsave_rand(x1, file = myfile) + z <- qattributes_rand(file = myfile) + stopifnot(attributes_identical(z, x1)) + time[i] <- Sys.time() - time[i] + do_gc() + } + printCarriage(sprintf("nested tibble test: %s s", signif(mean(time), 4))) + cat("\n") + } Rep 1 of 2 strings: 0, 0.005076 s strings: 1, 0.002036 s strings: 2, 0.0007339 s strings: 4, 0.001921 s strings: 8, 0.004111 s strings: 31, 0.002753 s strings: 33, 0.002836 s strings: 32, 0.0006014 s strings: 255, 0.001453 s strings: 257, 0.002617 s strings: 256, 0.003276 s strings: 65535, 0.001795 s strings: 65537, 0.002083 s strings: 65536, 0.003638 s strings: 1e+06, 0.003399 s Character Vectors: 0, 0.0001387 s Character Vectors: 1, 0.000832 s Character Vectors: 2, 0.0003414 s Character Vectors: 4, 0.0003589 s Character Vectors: 8, 0.0008636 s Character Vectors: 31, 0.001093 s Character Vectors: 33, 0.0002827 s Character Vectors: 32, 0.001071 s Character Vectors: 255, 0.0001197 s Character Vectors: 257, 0.0003357 s Character Vectors: 256, 0.0005503 s Character Vectors: 65535, 0.002241 s Character Vectors: 65537, 0.00205 s Character Vectors: 65536, 0.003117 s Stringfish: 0, 0.0002499 s Stringfish: 1, 0.001048 s Stringfish: 2, 0.0009109 s Stringfish: 4, 0.0004563 s Stringfish: 8, 0.0002209 s Stringfish: 31, 0.0002394 s Stringfish: 33, 0.0005563 s Stringfish: 32, 0.0006611 s Stringfish: 255, 0.0002089 s Stringfish: 257, 0.001178 s Stringfish: 256, 0.001986 s Stringfish: 65535, 0.002215 s Stringfish: 65537, 0.002438 s Stringfish: 65536, 0.002759 s Integers: 0, 0.001906 s Integers: 1, 0.002002 s Integers: 2, 0.001632 s Integers: 4, 0.001938 s Integers: 8, 0.000618 s Integers: 31, 0.001752 s Integers: 33, 0.002375 s Integers: 32, 0.002387 s Integers: 255, 0.001156 s Integers: 257, 0.001568 s Integers: 256, 0.001431 s Integers: 65535, 0.00332 s Integers: 65537, 0.003184 s Integers: 65536, 0.005374 s Integers: 1e+06, 0.008146 s Numeric: 0, 0.001155 s Numeric: 1, 0.002937 s Numeric: 2, 0.002018 s Numeric: 4, 0.001761 s Numeric: 8, 0.001579 s Numeric: 31, 0.00119 s Numeric: 33, 0.00321 s Numeric: 32, 0.001335 s Numeric: 255, 0.001461 s Numeric: 257, 0.001799 s Numeric: 256, 0.0009267 s Numeric: 65535, 0.008272 s Numeric: 65537, 0.006202 s Numeric: 65536, 0.007638 s Numeric: 1e+06, 0.1023 s Logical: 0, 0.002853 s Logical: 1, 0.0006909 s Logical: 2, 0.001544 s Logical: 4, 0.0009665 s Logical: 8, 0.007588 s Logical: 31, 0.001643 s Logical: 33, 0.002738 s Logical: 32, 0.002252 s Logical: 255, 0.005112 s Logical: 257, 0.000979 s Logical: 256, 0.001965 s Logical: 65535, 0.00435 s Logical: 65537, 0.002233 s Logical: 65536, 0.00511 s Logical: 1e+06, 0.01857 s List: 0, 0.00411 s List: 1, 0.002085 s List: 2, 0.001532 s List: 4, 0.001523 s List: 8, 0.0005638 s List: 31, 0.001628 s List: 33, 0.001027 s List: 32, 0.001868 s List: 255, 0.005381 s List: 257, 0.001439 s List: 256, 0.0006736 s List: 65535, 0.01795 s List: 65537, 0.01347 s List: 65536, 0.01544 s Data.frame test Data.table test Tibble test (Encoding test not run on windows) Complex: 0, 0.00816 s Complex: 1, 0.001206 s Complex: 2, 0.002268 s Complex: 4, 0.001132 s Complex: 8, 0.002071 s Complex: 31, 0.003491 s Complex: 33, 0.004722 s Complex: 32, 0.004679 s Complex: 255, 0.002638 s Complex: 257, 0.006062 s Complex: 256, 0.001501 s Complex: 65535, 0.0158 s Complex: 65537, 0.004619 s Complex: 65536, 0.02231 s Complex: 1e+06, 0.177 s Factors: 0, 0.003128 s Factors: 1, 0.002792 s Factors: 2, 0.001722 s Factors: 4, 0.002113 s Factors: 8, 0.004835 s Factors: 31, 0.001394 s Factors: 33, 0.001185 s Factors: 32, 0.002072 s Factors: 255, 0.001764 s Factors: 257, 0.001852 s Factors: 256, 0.001079 s Factors: 65535, 0.003369 s Factors: 65537, 0.001819 s Factors: 65536, 0.008563 s Factors: 1e+06, 0.01233 s Random objects: 1085280 bytes Random objects: 1049576 bytes Random objects: 1038160 bytes Random objects: 1030000 bytes Random objects: 1049864 bytes Random objects: 1077512 bytes Random objects: 1048912 bytes Random objects: 1081712 bytes Random objects: 0.02612 s Nested attributes: 5.7e+08 s Alt rep integer: 0.0231 s Environment test: 0.02955 s nested tibble test: 0.9541 s Rep 2 of 2 strings: 0, 0.004335 s strings: 1, 0.001849 s strings: 2, 0.002718 s strings: 4, 0.002674 s strings: 8, 0.001198 s strings: 31, 0.002937 s strings: 33, 0.001259 s strings: 32, 0.001307 s strings: 255, 0.002372 s strings: 257, 0.001791 s strings: 256, 0.001227 s strings: 65535, 0.002399 s strings: 65537, 0.001504 s strings: 65536, 0.001548 s strings: 1e+06, 0.003552 s Character Vectors: 0, 0.001077 s Character Vectors: 1, 0.0001466 s Character Vectors: 2, 0.0005527 s Character Vectors: 4, 0.0002294 s Character Vectors: 8, 0.001382 s Character Vectors: 31, 0.0001556 s Character Vectors: 33, 0.0002139 s Character Vectors: 32, 0.0007761 s Character Vectors: 255, 0.0001814 s Character Vectors: 257, 0.0003101 s Character Vectors: 256, 0.000769 s Character Vectors: 65535, 0.002905 s Character Vectors: 65537, 0.001864 s Character Vectors: 65536, 0.002553 s Stringfish: 0, 0.0006467 s Stringfish: 1, 0.0007777 s Stringfish: 2, 0.001071 s Stringfish: 4, 0.0005507 s Stringfish: 8, 0.0009289 s Stringfish: 31, 0.0008344 s Stringfish: 33, 0.000566 s Stringfish: 32, 0.0005916 s Stringfish: 255, 0.0004416 s Stringfish: 257, 0.0006092 s Stringfish: 256, 0.000888 s Stringfish: 65535, 0.003244 s Stringfish: 65537, 0.001915 s Stringfish: 65536, 0.002688 s Integers: 0, 0.002512 s Integers: 1, 0.002096 s Integers: 2, 0.002744 s Integers: 4, 0.001151 s Integers: 8, 0.002195 s Integers: 31, 0.001951 s Integers: 33, 0.001252 s Integers: 32, 0.002739 s Integers: 255, 0.002682 s Integers: 257, 0.00162 s Integers: 256, 0.001586 s Integers: 65535, 0.006232 s Integers: 65537, 0.007779 s Integers: 65536, 0.00525 s Integers: 1e+06, 0.03456 s Numeric: 0, 0.001918 s Numeric: 1, 0.001733 s Numeric: 2, 0.001918 s Numeric: 4, 0.0006793 s Numeric: 8, 0.00134 s Numeric: 31, 0.002152 s Numeric: 33, 0.001254 s Numeric: 32, 0.001733 s Numeric: 255, 0.001999 s Numeric: 257, 0.003106 s Numeric: 256, 0.00201 s Numeric: 65535, 0.007633 s Numeric: 65537, 0.008925 s Numeric: 65536, 0.002778 s Numeric: 1e+06, 0.1471 s Logical: 0, 0.002837 s Logical: 1, 0.004634 s Logical: 2, 0.002982 s Logical: 4, 0.006036 s Logical: 8, 0.001687 s Logical: 31, 0.002247 s Logical: 33, 0.001081 s Logical: 32, 0.003488 s Logical: 255, 0.001358 s Logical: 257, 0.002043 s Logical: 256, 0.001217 s Logical: 65535, 0.006469 s Logical: 65537, 0.005375 s Logical: 65536, 0.003286 s Logical: 1e+06, 0.1534 s List: 0, 0.002575 s List: 1, 0.001442 s List: 2, 0.001811 s List: 4, 0.001746 s List: 8, 0.001857 s List: 31, 0.002187 s List: 33, 0.0008894 s List: 32, 0.002081 s List: 255, 0.001587 s List: 257, 0.003007 s List: 256, 0.001677 s List: 65535, 0.01872 s List: 65537, 0.01119 s List: 65536, 0.01701 s Data.frame test Data.table test Tibble test (Encoding test not run on windows) Complex: 0, 0.00581 s Complex: 1, 0.002896 s Complex: 2, 0.003033 s Complex: 4, 0.002584 s Complex: 8, 0.002987 s Complex: 31, 0.001511 s Complex: 33, 0.003475 s Complex: 32, 0.001483 s Complex: 255, 0.005794 s Complex: 257, 0.004462 s Complex: 256, 0.001857 s Complex: 65535, 0.0113 s Complex: 65537, 0.02596 s Complex: 65536, 0.01463 s Complex: 1e+06, 0.1107 s Factors: 0, 0.004873 s Factors: 1, 0.002506 s Factors: 2, 0.001475 s Factors: 4, 0.001293 s Factors: 8, 0.001288 s Factors: 31, 0.001334 s Factors: 33, 0.004275 s Factors: 32, 0.002157 s Factors: 255, 0.00158 s Factors: 257, 0.002756 s Factors: 256, 0.00166 s Factors: 65535, 0.001191 s Factors: 65537, 0.002089 s Factors: 65536, 0.0009396 s Factors: 1e+06, 0.013 s Random objects: 1037864 bytes Random objects: 1034248 bytes Random objects: 1073864 bytes Random objects: 1060832 bytes Random objects: 1048256 bytes Random objects: 1093472 bytes Random objects: 1019488 bytes Random objects: 1037808 bytes Random objects: 0.01057 s Nested attributes: 5.7e+08 s Alt rep integer: 0.007697 s Environment test: 0.1686 s nested tibble test: 0.2315 s > > cat("tests done\n") tests done > rm(list = setdiff(ls(), c("total_time", "do_gc"))) > do_gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 661788 35.4 2448710 130.8 2499997 133.6 Vcells 2100984 16.1 21547642 164.4 22378794 170.8 > total_time <- Sys.time() - total_time > print(total_time) Time difference of 1.848676 mins > > proc.time() user system elapsed 106.43 11.57 111.04