From b1c4431f70e7c6cce002bd60af083d4ae03e5cb9 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 8 Oct 2026 09:25:32 -0400 Subject: [PATCH 01/20] add test case for fread N=cols rnorm --- .ci/atime/tests.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 2d342ded67..eca4d286b3 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -260,6 +260,22 @@ test.list <- atime::atime_test_list( } }, + "fread N=cols regression" = atime::atime_test( + N = 2^seq(0, 20), # smaller N because disk can be slow. + setup={ + set.seed(1) + n.rows <- 100 + input.vec <- rnorm(n.rows*N) + input.mat <- matrix(input.vec, n.rows, N) + input.dt <- data.table(input.mat) + input.csv <- tempfile() + data.table::fwrite(input.dt, input.csv) + }, + seconds.limit=0.1, + Fast="1.14.8", + Slow="1.18.6", + expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), + # Constant overhead improvement https://github.com/Rdatatable/data.table/pull/6925 # Test case adapted from https://github.com/Rdatatable/data.table/pull/7022#discussion_r2107900643 "fread disk overhead improved in #6925" = atime::atime_test( From d6338c9ea09286ecffd818e6e94ed6e583f1bb29 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 06:31:25 -0400 Subject: [PATCH 02/20] bisect.restore.fun --- .ci/atime/tests.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index eca4d286b3..3332563df9 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -1,3 +1,7 @@ +bisect.restore.fun <- function(tinfo){ + cat("", file.path(tinfo$checkout.path, ".gitattributes")) + gert::git_restore(".", repo=tinfo$checkout.path) +} pval.thresh <- 0.001 # to reduce false positives. # Test case adapted from https://github.com/Rdatatable/data.table/issues/6105#issue-2268691745 which is where the issue was reported. From d244da6fb55e020690d14fa53a46ac91c9eca75d Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 07:25:24 -0400 Subject: [PATCH 03/20] bisect viz --- .ci/atime/bisect.R | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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..e805351a58 --- /dev/null +++ b/.ci/atime/bisect.R @@ -0,0 +1,29 @@ +atime::bisect("~/R/data.table", "fread N=cols regression") + +library(data.table) +(results.wide <- data.table( + csv=Sys.glob("~/R/data.table/.ci/atime/bisect/fread_N=cols_regression/results/*") +)[ +, fread(csv), by=csv +][ +, rank := rank(time) +][order(rank)][, let( + Rank = factor(rank, labels=format(time)), + Status = factor(status) +)][]) +(results.long <- melt( + results.wide, + measure.vars=measure(variable, version, sep="."))) +library(ggplot2) + +gg <- ggplot()+ + geom_vline(aes( + xintercept=Rank, + linetype=Status), + data=results.wide)+ + geom_line(aes( + Rank, value, color=version, group=version), + data=results.long)+ + facet_grid(variable ~ ., scales="free")+ + theme(axis.text.x=element_text(angle=30, hjust=1)) +directlabels::direct.label(gg, "right.polygons") From bf228ab8bea10a7e31cc2653337a5ffec41d2e7a Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 10:55:51 -0400 Subject: [PATCH 04/20] not as fast/slow commits for fread test --- .ci/atime/tests.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 3332563df9..510fb18a78 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -276,7 +276,9 @@ test.list <- atime::atime_test_list( data.table::fwrite(input.dt, input.csv) }, seconds.limit=0.1, - Fast="1.14.8", + #Fast="1.14.8", + Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but use as Fast in bisect with Slow. + #"67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but use as Slow in bisect with Fast. Slow="1.18.6", expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), From c767d8f306d6447a3c3e93f907025b85d805eee3 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 11:07:28 -0400 Subject: [PATCH 05/20] fast-vs-mid --- .ci/atime/tests.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 510fb18a78..2251eb2fa0 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -276,10 +276,10 @@ test.list <- atime::atime_test_list( data.table::fwrite(input.dt, input.csv) }, seconds.limit=0.1, - #Fast="1.14.8", - Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but use as Fast in bisect with Slow. - #"67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but use as Slow in bisect with Fast. - Slow="1.18.6", + Fast="1.14.8", + #Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but use as Fast in bisect with Slow. + Slow="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but use as Slow in bisect with Fast. + #Slow="1.18.6", expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), # Constant overhead improvement https://github.com/Rdatatable/data.table/pull/6925 From 8e1eaf9a44665357d59c6a932b781f58f130fb5d Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 11:24:14 -0400 Subject: [PATCH 06/20] PRs --- .ci/atime/tests.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 2251eb2fa0..a690294a7a 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -277,9 +277,9 @@ test.list <- atime::atime_test_list( }, seconds.limit=0.1, Fast="1.14.8", - #Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but use as Fast in bisect with Slow. - Slow="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but use as Slow in bisect with Fast. - #Slow="1.18.6", + # Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as Fast in bisect with Slow=1.18.6 yields PR#7370. + # Slow="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as Slow in bisect with Fast=1.14.8 yields PR#7375. + Slow="1.18.6", expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), # Constant overhead improvement https://github.com/Rdatatable/data.table/pull/6925 From fc38138327e8192c765223e052a540045dccbe9d Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 11:27:20 -0400 Subject: [PATCH 07/20] bisect animint --- .ci/atime/bisect-animint.R | 154 ++++++++++++++++++++++++ .ci/atime/{bisect.R => bisect-ggplot.R} | 4 +- 2 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 .ci/atime/bisect-animint.R rename .ci/atime/{bisect.R => bisect-ggplot.R} (92%) diff --git a/.ci/atime/bisect-animint.R b/.ci/atime/bisect-animint.R new file mode 100644 index 0000000000..196ae63123 --- /dev/null +++ b/.ci/atime/bisect-animint.R @@ -0,0 +1,154 @@ +remotes::install_github("tdhock/atime@bisect") +pkg.path <- "~/R/data.table" +Test <- "fread N=cols regression" +atime::bisect(pkg.path, Test) + +Test.dir <- file.path(pkg.path, ".ci", "atime", "bisect", atime:::test_file_name(Test)) +library(data.table) +(results.wide <- data.table( + csv=Sys.glob(file.path(Test.dir, "csv", "*")) +)[ +, fread(csv), by=csv +][ +, rank := rank(time) +][order(rank)][, let( + Rank = factor(rank, labels=format(time)), + Status = factor(status) +)][]) +(results.long <- melt( + results.wide, + measure.vars=measure(variable, version, sep="."))) + +show.versions <- unique(results.long$version) +details.dt.list <- list() +dot.dt.list <- list() +common.dt.list <- list() +for(result.RData in Sys.glob(file.path(Test.dir, "RData", "*"))){ + (objs <- load(result.RData)) + commit <- sub(".RData", "", basename(result.RData)) + details <- tres.or.status$measurements[ + show.versions, + on="version", + data.table(commit, expr.name, version, N, median, min, max) + ] + common.dt.list[[commit]] <- details[, .( + versions=.N + ), by=N][ + versions==max(versions) + ][.N, data.table(commit, N)] + evers <- unique(details[, .(expr.name, version)]) + details.dt.list[[commit]] <- details + dot.dt.list[[commit]] <- data.table( + commit, + tpred$prediction[evers, on="expr.name"]) +} +(details.dt <- rbindlist(details.dt.list)) +(dot.dt <- rbindlist(dot.dt.list)) +(common.dt <- rbindlist(common.dt.list)) + +limit.dt <- data.table(seconds=tpred$seconds.limit) +library(animint2) +animint( + overview=ggplot()+ + ggtitle("Overview, select commit")+ + theme_bw()+ + geom_tallrect(aes( + xmin=rank-0.5, xmax=rank+0.5, + key=rank, + fill=Status), + color=NA, + data=results.wide)+ + geom_line(aes( + rank, value, color=version, group=version), + data=results.long)+ + facet_grid(variable ~ ., scales="free")+ + theme(axis.text.x=element_text(angle=30, hjust=1))+ + geom_label_aligned(aes( + rank, value, label=version, color=version), + data=results.long[rank==max(rank)], + hjust=0, + alignment="vertical")+ + scale_fill_manual(values=c( + "0"="grey", + "1"="white"))+ + scale_y_continuous("")+ + scale_x_continuous("commit rank over time")+ + geom_tallrect(aes( + xmin=rank-0.5, xmax=rank+0.5), + clickSelects="commit", + alpha=1, + alpha_off=0, + color="black", + color_off=NA, + fill=NA, + data=results.wide), + details=ggplot()+ + ggtitle("Details for selected commit")+ + theme_bw()+ + theme(legend.position="none")+ + theme_animint(width=1000)+ + geom_hline(aes( + yintercept=seconds), + color="grey", + data=limit.dt)+ + geom_text(aes( + 0, seconds*1.1, + label=sprintf( + "time limit = %s seconds", + paste(seconds) + )), + hjust=0, + color="grey50", + data=limit.dt)+ + geom_vline(aes( + xintercept=N, + key=1), + data=common.dt, + color="grey", + showSelected="commit")+ + geom_text(aes( + N, 0, label=sprintf("largest common N=%s", paste(N)), + key=1), + data=common.dt, + hjust=1, + color="grey50", + showSelected="commit")+ + geom_text(aes( + 0, 0, label=commit, + key=1), + hjust=0, + vjust=0, + data=common.dt, + showSelected="commit")+ + geom_ribbon(aes( + N, ymin=min, ymax=max, + key=version, fill=version, group=version), + showSelected=c("version","commit"), + alpha=0.5, + color=NA, + data=details.dt)+ + geom_line(aes( + N, median, + key=version, color=version, group=version), + showSelected=c("version","commit"), + data=details.dt)+ + geom_point(aes( + N, unit.value, + key=version, color=version), + showSelected=c("version","commit"), + fill="white", + data=dot.dt)+ + geom_label_aligned(aes( + N, unit.value, label=version, + key=version, color=version), + showSelected=c("version","commit"), + alignment="horizontal", + vjust=-0.1, + alpha=0.5, + data=dot.dt)+ + scale_x_log10()+ + scale_y_log10("seconds"), + duration=list( + commit=1000) +) + diff --git a/.ci/atime/bisect.R b/.ci/atime/bisect-ggplot.R similarity index 92% rename from .ci/atime/bisect.R rename to .ci/atime/bisect-ggplot.R index e805351a58..ff7ef1e853 100644 --- a/.ci/atime/bisect.R +++ b/.ci/atime/bisect-ggplot.R @@ -1,8 +1,9 @@ +remotes::install_github("tdhock/atime@bisect") atime::bisect("~/R/data.table", "fread N=cols regression") library(data.table) (results.wide <- data.table( - csv=Sys.glob("~/R/data.table/.ci/atime/bisect/fread_N=cols_regression/results/*") + csv=Sys.glob("~/R/data.table/.ci/atime/bisect/fread_N=cols_regression/csv/*") )[ , fread(csv), by=csv ][ @@ -15,7 +16,6 @@ library(data.table) results.wide, measure.vars=measure(variable, version, sep="."))) library(ggplot2) - gg <- ggplot()+ geom_vline(aes( xintercept=Rank, From a11b97bb39e1d658047670050d2ca5625b537372 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 9 Oct 2026 12:56:59 -0400 Subject: [PATCH 08/20] bisect other test case --- .ci/atime/bisect-animint.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/atime/bisect-animint.R b/.ci/atime/bisect-animint.R index 196ae63123..398d51898c 100644 --- a/.ci/atime/bisect-animint.R +++ b/.ci/atime/bisect-animint.R @@ -1,8 +1,14 @@ remotes::install_github("tdhock/atime@bisect") pkg.path <- "~/R/data.table" + Test <- "fread N=cols regression" atime::bisect(pkg.path, Test) +if(FALSE){ + Test <- "DT[by] fixed in #4558" + atime::bisect(pkg.path, Test, "Regression", "Before") +} + Test.dir <- file.path(pkg.path, ".ci", "atime", "bisect", atime:::test_file_name(Test)) library(data.table) (results.wide <- data.table( From 142eb2185e266543dc7332c4839dd7a80b535e3d Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 11:45:45 -0400 Subject: [PATCH 09/20] run bisects --- .ci/atime/bisect-7907.R | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .ci/atime/bisect-7907.R diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R new file mode 100644 index 0000000000..dc880ce18c --- /dev/null +++ b/.ci/atime/bisect-7907.R @@ -0,0 +1,19 @@ +pkg.path <- "~/R/data.table" +Test <- "fread N=cols regression" +library(data.table) +if(FALSE){ + remotes::install_github("tdhock/atime@bisect") + atime::atime_versions_remove("data.table") +} +library(data.table) +(bisect.dt <- rowwiseDT( + old=, new=, label=, expected=, stage=, + "1.14.8", "1.18.6", "PR7406", "?", "discovery", + "PR7406", "1.18.6", "PR7370", "?", "discovery", + "1.14.8", "PR7383", "PR4164", "?", "discovery", + "PR7375", "1.18.6", "PR7370", "PR7370", "final", + "1.14.8", "Parent7370", "PR7375", "PR7375", "final")) +for(bisect.i in 1:nrow(bisect.dt)){ + print(bisect.row <- bisect.dt[bisect.i]) + bisect.row[, atime::bisect(pkg.path, Test, old, new)] +} From c6ea6f0eb200c66e4f70b9704606befaf3be3027 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 11:46:15 -0400 Subject: [PATCH 10/20] commits --- .ci/atime/bisect-animint.R | 5 ----- .ci/atime/tests.R | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.ci/atime/bisect-animint.R b/.ci/atime/bisect-animint.R index 398d51898c..e6cf279961 100644 --- a/.ci/atime/bisect-animint.R +++ b/.ci/atime/bisect-animint.R @@ -4,11 +4,6 @@ pkg.path <- "~/R/data.table" Test <- "fread N=cols regression" atime::bisect(pkg.path, Test) -if(FALSE){ - Test <- "DT[by] fixed in #4558" - atime::bisect(pkg.path, Test, "Regression", "Before") -} - Test.dir <- file.path(pkg.path, ".ci", "atime", "bisect", atime:::test_file_name(Test)) library(data.table) (results.wide <- data.table( diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index a690294a7a..88bbb1e750 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -277,8 +277,11 @@ test.list <- atime::atime_test_list( }, seconds.limit=0.1, Fast="1.14.8", - # Fast="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as Fast in bisect with Slow=1.18.6 yields PR#7370. - # Slow="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as Slow in bisect with Fast=1.14.8 yields PR#7375. + PR7375="59f966cf6839a0494e42ed1ab98616eea03dcb36", #fread slowdown added comment.char arg + PR7383="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as new in bisect with old=1.14.8 yields PR#7375. + PR7406="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as old in bisect with new=1.18.6 yields PR#7370. + Parent7370="1685a3b47d48f323afeae589545f7cbb7717ec28", + PR7370="df7fa8071c6b818d24e47cc1a84a6dc0491550d6", #fread slowdown sep detection single column quoted Slow="1.18.6", expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), From 825e7405959b6394e25a7c7ee435a75fbd701dbe Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 11:52:40 -0400 Subject: [PATCH 11/20] FastSlow --- .ci/atime/bisect-7907.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R index dc880ce18c..50f70b1e61 100644 --- a/.ci/atime/bisect-7907.R +++ b/.ci/atime/bisect-7907.R @@ -8,11 +8,11 @@ if(FALSE){ library(data.table) (bisect.dt <- rowwiseDT( old=, new=, label=, expected=, stage=, - "1.14.8", "1.18.6", "PR7406", "?", "discovery", - "PR7406", "1.18.6", "PR7370", "?", "discovery", - "1.14.8", "PR7383", "PR4164", "?", "discovery", - "PR7375", "1.18.6", "PR7370", "PR7370", "final", - "1.14.8", "Parent7370", "PR7375", "PR7375", "final")) + "Fast", "Slow", "PR7406", "?", "discovery", + "PR7406", "Slow", "PR7370", "?", "discovery", + "Fast", "PR7383", "PR4164", "?", "discovery", + "PR7375", "Slow", "PR7370", "PR7370", "final", + "Fast", "Parent7370", "PR7375", "PR7375", "final")) for(bisect.i in 1:nrow(bisect.dt)){ print(bisect.row <- bisect.dt[bisect.i]) bisect.row[, atime::bisect(pkg.path, Test, old, new)] From 324282df422c259b2b471a1f4e0a767e75e26df9 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 12:15:53 -0400 Subject: [PATCH 12/20] file= --- .ci/atime/tests.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 88bbb1e750..2b08daa7d0 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -1,5 +1,5 @@ bisect.restore.fun <- function(tinfo){ - cat("", file.path(tinfo$checkout.path, ".gitattributes")) + cat("", file=file.path(tinfo$checkout.path, ".gitattributes")) gert::git_restore(".", repo=tinfo$checkout.path) } pval.thresh <- 0.001 # to reduce false positives. From 23c48ee3c9d5d361176518a719268bbe110a0b7b Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 12:49:18 -0400 Subject: [PATCH 13/20] finer grid --- .ci/atime/bisect-7907.R | 4 ++++ .ci/atime/tests.R | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R index 50f70b1e61..e5199c56c4 100644 --- a/.ci/atime/bisect-7907.R +++ b/.ci/atime/bisect-7907.R @@ -4,6 +4,10 @@ library(data.table) if(FALSE){ remotes::install_github("tdhock/atime@bisect") atime::atime_versions_remove("data.table") + tinfo <- atime::atime_pkg_test_info(pkg.path) + tcall <- tinfo$test.call[[Test]] + tres <- eval(tcall) + plot(tres) } library(data.table) (bisect.dt <- rowwiseDT( diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 2b08daa7d0..58e92fd254 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -265,7 +265,7 @@ test.list <- atime::atime_test_list( }, "fread N=cols regression" = atime::atime_test( - N = 2^seq(0, 20), # smaller N because disk can be slow. + N = unique(as.integer(2^seq(0, 20, by=0.5))), # finer N grid for git bisect. setup={ set.seed(1) n.rows <- 100 From 9abd88da480c9360cf0aa6828a5f606fc6246fd2 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Thu, 15 Oct 2026 12:50:27 -0400 Subject: [PATCH 14/20] even finer --- .ci/atime/tests.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 58e92fd254..88f8f31831 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -265,7 +265,7 @@ test.list <- atime::atime_test_list( }, "fread N=cols regression" = atime::atime_test( - N = unique(as.integer(2^seq(0, 20, by=0.5))), # finer N grid for git bisect. + N = unique(as.integer(2^seq(0, 20, by=0.25))), # finer N grid for git bisect. setup={ set.seed(1) n.rows <- 100 From a6ec41737feac95ce82b522acea1e017b504aeee Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 16 Oct 2026 13:13:00 -0400 Subject: [PATCH 15/20] comment extra commits --- .ci/atime/tests.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 88f8f31831..c9e33826bb 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -277,11 +277,11 @@ test.list <- atime::atime_test_list( }, seconds.limit=0.1, Fast="1.14.8", - PR7375="59f966cf6839a0494e42ed1ab98616eea03dcb36", #fread slowdown added comment.char arg - PR7383="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as new in bisect with old=1.14.8 yields PR#7375. - PR7406="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as old in bisect with new=1.18.6 yields PR#7370. - Parent7370="1685a3b47d48f323afeae589545f7cbb7717ec28", - PR7370="df7fa8071c6b818d24e47cc1a84a6dc0491550d6", #fread slowdown sep detection single column quoted + ## PR7375="59f966cf6839a0494e42ed1ab98616eea03dcb36", #fread slowdown added comment.char arg + ## PR7383="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as new in bisect with old=1.14.8 yields PR#7375. + ## PR7406="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as old in bisect with new=1.18.6 yields PR#7370. + ## Parent7370="1685a3b47d48f323afeae589545f7cbb7717ec28", + ## PR7370="df7fa8071c6b818d24e47cc1a84a6dc0491550d6", #fread slowdown sep detection single column quoted Slow="1.18.6", expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), From b13bac62fa65f7cde2d6dcd10c8aa057e6eb3d83 Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 16 Oct 2026 13:45:57 -0400 Subject: [PATCH 16/20] comments --- .ci/atime/bisect-7907.R | 16 +++++++----- .ci/atime/bisect-animint.R | 51 ++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R index e5199c56c4..743da46f7f 100644 --- a/.ci/atime/bisect-7907.R +++ b/.ci/atime/bisect-7907.R @@ -1,17 +1,21 @@ +## This script is for running the git bisect analysis in PR7907, which +## revealed two slowdowns in fread(). pkg.path <- "~/R/data.table" Test <- "fread N=cols regression" library(data.table) if(FALSE){ + ## atime functions for git bisect were added in this branch: remotes::install_github("tdhock/atime@bisect") + ## if you want to start the bisect over from scratch, first remove + ## all historical versions of data.table installed by atime: atime::atime_versions_remove("data.table") - tinfo <- atime::atime_pkg_test_info(pkg.path) - tcall <- tinfo$test.call[[Test]] - tres <- eval(tcall) - plot(tres) } -library(data.table) +## Commits other than Fast and Slow have been commented in tests.R so +## to re-run the bisect, you would first have to uncomment them in +## tests.R. These are the commits visualized on +## https://tdhock.github.io/2026-10-15-bisect-performance-pr7907 (bisect.dt <- rowwiseDT( - old=, new=, label=, expected=, stage=, + old=, new=, label=, expected=, stage=, "Fast", "Slow", "PR7406", "?", "discovery", "PR7406", "Slow", "PR7370", "?", "discovery", "Fast", "PR7383", "PR4164", "?", "discovery", diff --git a/.ci/atime/bisect-animint.R b/.ci/atime/bisect-animint.R index e6cf279961..8ebae965d8 100644 --- a/.ci/atime/bisect-animint.R +++ b/.ci/atime/bisect-animint.R @@ -1,11 +1,8 @@ -remotes::install_github("tdhock/atime@bisect") -pkg.path <- "~/R/data.table" - -Test <- "fread N=cols regression" -atime::bisect(pkg.path, Test) - -Test.dir <- file.path(pkg.path, ".ci", "atime", "bisect", atime:::test_file_name(Test)) +## This script is for visualizing results computed in bisect-7907.R +library(animint2) library(data.table) + +Test.dir <- "bisect/fread_N_cols_regression/Fast-Slow" (results.wide <- data.table( csv=Sys.glob(file.path(Test.dir, "csv", "*")) )[ @@ -18,41 +15,37 @@ library(data.table) )][]) (results.long <- melt( results.wide, - measure.vars=measure(variable, version, sep="."))) + measure.vars=measure(variable, expr.name, sep="."))) -show.versions <- unique(results.long$version) details.dt.list <- list() dot.dt.list <- list() common.dt.list <- list() for(result.RData in Sys.glob(file.path(Test.dir, "RData", "*"))){ (objs <- load(result.RData)) commit <- sub(".RData", "", basename(result.RData)) - details <- tres.or.status$measurements[ - show.versions, - on="version", - data.table(commit, expr.name, version, N, median, min, max) - ] + details <- tres.or.status$measurements[, .( + commit, expr.name, N, median, min, max + )] common.dt.list[[commit]] <- details[, .( versions=.N ), by=N][ versions==max(versions) ][.N, data.table(commit, N)] - evers <- unique(details[, .(expr.name, version)]) details.dt.list[[commit]] <- details dot.dt.list[[commit]] <- data.table( commit, - tpred$prediction[evers, on="expr.name"]) + tpred$prediction) } (details.dt <- rbindlist(details.dt.list)) (dot.dt <- rbindlist(dot.dt.list)) (common.dt <- rbindlist(common.dt.list)) limit.dt <- data.table(seconds=tpred$seconds.limit) -library(animint2) animint( overview=ggplot()+ ggtitle("Overview, select commit")+ theme_bw()+ + theme_animint(height=600)+ geom_tallrect(aes( xmin=rank-0.5, xmax=rank+0.5, key=rank, @@ -60,12 +53,12 @@ animint( color=NA, data=results.wide)+ geom_line(aes( - rank, value, color=version, group=version), + rank, value, color=expr.name, group=expr.name), data=results.long)+ facet_grid(variable ~ ., scales="free")+ theme(axis.text.x=element_text(angle=30, hjust=1))+ geom_label_aligned(aes( - rank, value, label=version, color=version), + rank, value, label=expr.name, color=expr.name), data=results.long[rank==max(rank)], hjust=0, alignment="vertical")+ @@ -87,7 +80,7 @@ animint( ggtitle("Details for selected commit")+ theme_bw()+ theme(legend.position="none")+ - theme_animint(width=1000)+ + theme_animint(width=600, height=600, last_in_row=TRUE)+ geom_hline(aes( yintercept=seconds), color="grey", @@ -123,26 +116,26 @@ animint( showSelected="commit")+ geom_ribbon(aes( N, ymin=min, ymax=max, - key=version, fill=version, group=version), - showSelected=c("version","commit"), + key=expr.name, fill=expr.name, group=expr.name), + showSelected=c("expr.name","commit"), alpha=0.5, color=NA, data=details.dt)+ geom_line(aes( N, median, - key=version, color=version, group=version), - showSelected=c("version","commit"), + key=expr.name, color=expr.name, group=expr.name), + showSelected=c("expr.name","commit"), data=details.dt)+ geom_point(aes( N, unit.value, - key=version, color=version), - showSelected=c("version","commit"), + key=expr.name, color=expr.name), + showSelected=c("expr.name","commit"), fill="white", data=dot.dt)+ geom_label_aligned(aes( - N, unit.value, label=version, - key=version, color=version), - showSelected=c("version","commit"), + N, unit.value, label=expr.name, + key=expr.name, color=expr.name), + showSelected=c("expr.name","commit"), alignment="horizontal", vjust=-0.1, alpha=0.5, From 3847bbba4c294117573c06958bb2b1d57ed04a0b Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 16 Oct 2026 13:46:19 -0400 Subject: [PATCH 17/20] rmgg --- .ci/atime/bisect-ggplot.R | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .ci/atime/bisect-ggplot.R diff --git a/.ci/atime/bisect-ggplot.R b/.ci/atime/bisect-ggplot.R deleted file mode 100644 index ff7ef1e853..0000000000 --- a/.ci/atime/bisect-ggplot.R +++ /dev/null @@ -1,29 +0,0 @@ -remotes::install_github("tdhock/atime@bisect") -atime::bisect("~/R/data.table", "fread N=cols regression") - -library(data.table) -(results.wide <- data.table( - csv=Sys.glob("~/R/data.table/.ci/atime/bisect/fread_N=cols_regression/csv/*") -)[ -, fread(csv), by=csv -][ -, rank := rank(time) -][order(rank)][, let( - Rank = factor(rank, labels=format(time)), - Status = factor(status) -)][]) -(results.long <- melt( - results.wide, - measure.vars=measure(variable, version, sep="."))) -library(ggplot2) -gg <- ggplot()+ - geom_vline(aes( - xintercept=Rank, - linetype=Status), - data=results.wide)+ - geom_line(aes( - Rank, value, color=version, group=version), - data=results.long)+ - facet_grid(variable ~ ., scales="free")+ - theme(axis.text.x=element_text(angle=30, hjust=1)) -directlabels::direct.label(gg, "right.polygons") From f866d2e0ad988b396188d17917bddc8411e486eb Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 16 Oct 2026 13:48:12 -0400 Subject: [PATCH 18/20] commint --- .ci/atime/tests.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index c9e33826bb..313ce6fa91 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -1,4 +1,6 @@ bisect.restore.fun <- function(tinfo){ + ## necessary to avoid failed checkout when bisecting some old commits + ## https://github.com/Rdatatable/data.table/issues/7909 cat("", file=file.path(tinfo$checkout.path, ".gitattributes")) gert::git_restore(".", repo=tinfo$checkout.path) } From f63bb00778726657ac272afb27d6f756d018a03e Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 23 Oct 2026 21:25:23 -0400 Subject: [PATCH 19/20] bisect.commits --- .ci/atime/bisect-7907.R | 6 ++---- .ci/atime/tests.R | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R index 743da46f7f..35926ec75c 100644 --- a/.ci/atime/bisect-7907.R +++ b/.ci/atime/bisect-7907.R @@ -10,13 +10,11 @@ if(FALSE){ ## all historical versions of data.table installed by atime: atime::atime_versions_remove("data.table") } -## Commits other than Fast and Slow have been commented in tests.R so -## to re-run the bisect, you would first have to uncomment them in -## tests.R. These are the commits visualized on +## These are the commits visualized on ## https://tdhock.github.io/2026-10-15-bisect-performance-pr7907 (bisect.dt <- rowwiseDT( old=, new=, label=, expected=, stage=, - "Fast", "Slow", "PR7406", "?", "discovery", + "Fast", "Slow", "Parent7370", "?", "discovery", "PR7406", "Slow", "PR7370", "?", "discovery", "Fast", "PR7383", "PR4164", "?", "discovery", "PR7375", "Slow", "PR7370", "PR7370", "final", diff --git a/.ci/atime/tests.R b/.ci/atime/tests.R index 313ce6fa91..f8b58a073a 100644 --- a/.ci/atime/tests.R +++ b/.ci/atime/tests.R @@ -279,12 +279,12 @@ test.list <- atime::atime_test_list( }, seconds.limit=0.1, Fast="1.14.8", - ## PR7375="59f966cf6839a0494e42ed1ab98616eea03dcb36", #fread slowdown added comment.char arg - ## PR7383="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #not as slow as Slow, but using this as new in bisect with old=1.14.8 yields PR#7375. - ## PR7406="1685a3b47d48f323afeae589545f7cbb7717ec28", #not as fast as Fast, but using this as old in bisect with new=1.18.6 yields PR#7370. - ## Parent7370="1685a3b47d48f323afeae589545f7cbb7717ec28", - ## PR7370="df7fa8071c6b818d24e47cc1a84a6dc0491550d6", #fread slowdown sep detection single column quoted Slow="1.18.6", + bisect.commits=c( + PR7375="59f966cf6839a0494e42ed1ab98616eea03dcb36", #first fread slowdown to intermediate performance, added comment.char arg + PR7383="67db7f7fb33b99da8cc5dc575714924b96d0f0fe", #intermediate performance, using this as new in bisect with old=1.14.8 yields PR#7375. + Parent7370="1685a3b47d48f323afeae589545f7cbb7717ec28", #intermediate performance, using this as old in bisect with new=1.18.6 yields PR#7370. + PR7370="df7fa8071c6b818d24e47cc1a84a6dc0491550d6"), #second slowdown to same performance as Slow, sep detection single column quoted expr=data.table::fread(input.csv, showProgress = FALSE, nThread=1)), # Constant overhead improvement https://github.com/Rdatatable/data.table/pull/6925 From 8f53e1e683572f6fafdd3ac0b5ef4c73fc0d99af Mon Sep 17 00:00:00 2001 From: Toby Dylan Hocking Date: Fri, 23 Oct 2026 21:43:37 -0400 Subject: [PATCH 20/20] rm install_github --- .ci/atime/bisect-7907.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/.ci/atime/bisect-7907.R b/.ci/atime/bisect-7907.R index 35926ec75c..a2ff3e68ce 100644 --- a/.ci/atime/bisect-7907.R +++ b/.ci/atime/bisect-7907.R @@ -4,8 +4,6 @@ pkg.path <- "~/R/data.table" Test <- "fread N=cols regression" library(data.table) if(FALSE){ - ## atime functions for git bisect were added in this branch: - remotes::install_github("tdhock/atime@bisect") ## if you want to start the bisect over from scratch, first remove ## all historical versions of data.table installed by atime: atime::atime_versions_remove("data.table")