Repository navigation
add test case for fread N=cols rnorm #7907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tdhock
wants to merge
21
commits into
master
Choose a base branch
from
atime-fread-cols
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b1c4431
add test case for fread N=cols rnorm
tdhock d6338c9
bisect.restore.fun
tdhock d244da6
bisect viz
tdhock bf228ab
not as fast/slow commits for fread test
tdhock c767d8f
fast-vs-mid
tdhock 8e1eaf9
PRs
tdhock fc38138
bisect animint
tdhock a11b97b
bisect other test case
tdhock 142eb21
run bisects
tdhock c6ea6f0
commits
tdhock 825e740
FastSlow
tdhock 324282d
file=
tdhock 23c48ee
finer grid
tdhock 9abd88d
even finer
tdhock 587d34f
Merge branch 'master' into atime-fread-cols
tdhock a6ec417
comment extra commits
tdhock b13bac6
comments
tdhock 3847bbb
rmgg
tdhock f866d2e
commint
tdhock f63bb00
bisect.commits
tdhock 8f53e1e
rm install_github
tdhock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ## 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){ | ||
| ## 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") | ||
| } | ||
| ## 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", "Parent7370", "?", "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)] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| ## 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", "*")) | ||
| )[ | ||
| , 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, expr.name, sep="."))) | ||
|
|
||
| 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[, .( | ||
| commit, expr.name, N, median, min, max | ||
| )] | ||
| common.dt.list[[commit]] <- details[, .( | ||
| versions=.N | ||
| ), by=N][ | ||
| versions==max(versions) | ||
| ][.N, data.table(commit, N)] | ||
| details.dt.list[[commit]] <- details | ||
| dot.dt.list[[commit]] <- data.table( | ||
| commit, | ||
| 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) | ||
| 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, | ||
| fill=Status), | ||
| color=NA, | ||
| data=results.wide)+ | ||
| geom_line(aes( | ||
| 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=expr.name, color=expr.name), | ||
| 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=600, height=600, last_in_row=TRUE)+ | ||
| 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=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=expr.name, color=expr.name, group=expr.name), | ||
| showSelected=c("expr.name","commit"), | ||
| data=details.dt)+ | ||
| geom_point(aes( | ||
| N, unit.value, | ||
| key=expr.name, color=expr.name), | ||
| showSelected=c("expr.name","commit"), | ||
| fill="white", | ||
| data=dot.dt)+ | ||
| geom_label_aligned(aes( | ||
| 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, | ||
| data=dot.dt)+ | ||
| scale_x_log10()+ | ||
| scale_y_log10("seconds"), | ||
| duration=list( | ||
| commit=1000) | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
bisect.commitsarg is a new atime feature, which lets us tag some commits which we can use as old/new inatime::bisect(), but which do not show up in the regular atime CI plots.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is taken from the result in the artifact zip:

we do not see any of the bisect commits, which is good to avoid visual clutter in the CI results.