From f129dc01e3e38d697d3dcc0a20f273054c005a11 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Tue, 31 Mar 2026 11:56:07 -0400 Subject: [PATCH 1/4] bisect-atime --- .ci/atime/bisect.R | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .ci/atime/bisect.R diff --git a/.ci/atime/bisect.R b/.ci/atime/bisect.R new file mode 100644 index 0000000000..2037d5f9d8 --- /dev/null +++ b/.ci/atime/bisect.R @@ -0,0 +1,9 @@ +tinfo <- atime::atime_pkg_test_info("../..") +names(tinfo$test.call) +tname <- "DT[by] fixed in #4558" +tcall <- tinfo$test.call[[tname]] +tres <- eval(tcall) +subject <- "void writeBool8(int8_t *col, int64_t row, char **pch) +void writeBool32(const void *col, int64_t row, char **pch)" +gsub("write(.*?)\\(.*? *col,", "write\\1(const void *col,", subject) +plot(tres) From 465510ef1e685b63c268e9642ccd25653a68495d Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Tue, 31 Mar 2026 15:16:51 -0400 Subject: [PATCH 2/4] bisect+run.sh --- .ci/atime/bisect-7687.R | 16 ++++++++++++++++ .ci/atime/bisect-7687.sh | 6 ++++++ .ci/atime/run-7687.sh | 5 +++++ 3 files changed, 27 insertions(+) create mode 100644 .ci/atime/bisect-7687.R create mode 100644 .ci/atime/bisect-7687.sh create mode 100644 .ci/atime/run-7687.sh diff --git a/.ci/atime/bisect-7687.R b/.ci/atime/bisect-7687.R new file mode 100644 index 0000000000..2eb08063e0 --- /dev/null +++ b/.ci/atime/bisect-7687.R @@ -0,0 +1,16 @@ +tinfo <- atime::atime_pkg_test_info("~/R/data.table") +names(tinfo$test.call) +tname <- "DT[by] fixed in #4558" +tcall <- tinfo$test.call[[tname]] +hist.sha.list <- as.list(tcall[c("Before", "Regression", "Fixed")]) +pr.sha.list <- tcall$sha.vec +HEAD <- grep("HEAD", names(pr.sha.list), value=TRUE) +tcall[c("Before", "Regression", "Fixed")] <- NULL +tcall$sha.vec <- c(hist.sha.list, pr.sha.list)[c(HEAD, "Before")] +names(tcall$sha.vec) <- c("HEAD","Before") +tres <- eval(tcall) +library(data.table) +print(meas_wide <- dcast( + tres$meas, N ~ expr.name, value.var="kilobytes" +)[, ratio := HEAD/Before][max(which(!is.na(ratio)))]) +q(status=ifelse(meas_wide$ratio>1.4, 1, 0)) diff --git a/.ci/atime/bisect-7687.sh b/.ci/atime/bisect-7687.sh new file mode 100644 index 0000000000..3c0fbe9aab --- /dev/null +++ b/.ci/atime/bisect-7687.sh @@ -0,0 +1,6 @@ +## git bisect old=equal perf, new=divergent. +cp tests.R ~/tests.R +git bisect start +git bisect old 90f1c1e7b4811ceaef4848a2805a2295d9e5c5f2 +git bisect new master +git bisect run bash ~/R/data.table/.ci/atime/run-7687.sh diff --git a/.ci/atime/run-7687.sh b/.ci/atime/run-7687.sh new file mode 100644 index 0000000000..c217e52ec9 --- /dev/null +++ b/.ci/atime/run-7687.sh @@ -0,0 +1,5 @@ +ATIME=~/R/data.table/.ci/atime +mkdir -p $ATIME +cp ~/tests.R $ATIME/tests.R +Rscript $ATIME/bisect-7687.R + From a616766318ab3265453f9e92af650f39f23e51a3 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Tue, 31 Mar 2026 15:20:28 -0400 Subject: [PATCH 3/4] rename --- .ci/atime/bisect.R | 9 --------- .ci/atime/{bisect-7687.R => run-7687.R} | 0 .ci/atime/run-7687.sh | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 .ci/atime/bisect.R rename .ci/atime/{bisect-7687.R => run-7687.R} (100%) diff --git a/.ci/atime/bisect.R b/.ci/atime/bisect.R deleted file mode 100644 index 2037d5f9d8..0000000000 --- a/.ci/atime/bisect.R +++ /dev/null @@ -1,9 +0,0 @@ -tinfo <- atime::atime_pkg_test_info("../..") -names(tinfo$test.call) -tname <- "DT[by] fixed in #4558" -tcall <- tinfo$test.call[[tname]] -tres <- eval(tcall) -subject <- "void writeBool8(int8_t *col, int64_t row, char **pch) -void writeBool32(const void *col, int64_t row, char **pch)" -gsub("write(.*?)\\(.*? *col,", "write\\1(const void *col,", subject) -plot(tres) diff --git a/.ci/atime/bisect-7687.R b/.ci/atime/run-7687.R similarity index 100% rename from .ci/atime/bisect-7687.R rename to .ci/atime/run-7687.R diff --git a/.ci/atime/run-7687.sh b/.ci/atime/run-7687.sh index c217e52ec9..92946ba7c0 100644 --- a/.ci/atime/run-7687.sh +++ b/.ci/atime/run-7687.sh @@ -1,5 +1,5 @@ ATIME=~/R/data.table/.ci/atime mkdir -p $ATIME cp ~/tests.R $ATIME/tests.R -Rscript $ATIME/bisect-7687.R +Rscript $ATIME/run-7687.R From ce8cea275923c56e21f54f7f38187d8cdf2452e5 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Wed, 1 Apr 2026 10:21:10 -0400 Subject: [PATCH 4/4] ratios --- .ci/atime/run-7687-ratios.R | 13 +++++++++++++ .ci/atime/run-7687.R | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 .ci/atime/run-7687-ratios.R diff --git a/.ci/atime/run-7687-ratios.R b/.ci/atime/run-7687-ratios.R new file mode 100644 index 0000000000..95c300c496 --- /dev/null +++ b/.ci/atime/run-7687-ratios.R @@ -0,0 +1,13 @@ +library(data.table) +tres <- readRDS("run-7687.rds") +tref <- atime::references_best(tres) +plot(tref) +dcast( + tref$meas, N + unit ~ expr.name, value.var="empirical" +)[, ratio := HEAD/Before][, inverse := 1/ratio][!is.na(ratio)][N==max(N)] +tpred <- predict(tref, seconds=1, kilobytes=1e4) +tpred <- predict(tref, seconds=1, kilobytes=2e4) +plot(tpred) +dcast( + tpred$prediction, unit ~ expr.name, value.var="N" +)[, ratio := Before/HEAD][, inverse := 1/ratio][] diff --git a/.ci/atime/run-7687.R b/.ci/atime/run-7687.R index 2eb08063e0..c2aff8e7a8 100644 --- a/.ci/atime/run-7687.R +++ b/.ci/atime/run-7687.R @@ -8,7 +8,9 @@ HEAD <- grep("HEAD", names(pr.sha.list), value=TRUE) tcall[c("Before", "Regression", "Fixed")] <- NULL tcall$sha.vec <- c(hist.sha.list, pr.sha.list)[c(HEAD, "Before")] names(tcall$sha.vec) <- c("HEAD","Before") +##tcall$seconds.limit <- 1 tres <- eval(tcall) +saveRDS(tres, "run-7687.rds") library(data.table) print(meas_wide <- dcast( tres$meas, N ~ expr.name, value.var="kilobytes"