-
Notifications
You must be signed in to change notification settings - Fork 978
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
use atime_test/atime_test_list to define performance tests #6102
Conversation
Generated via commit 77917ad Download link for the artifact containing the test results: ↓ atime-results.zip Time taken to finish the standard R installation steps: 11 minutes and 50 seconds Time taken to run |
"setDT improved in #5427" = list( | ||
pkg.edit.fun = pkg.edit.fun, | ||
N = 10^seq(1, 7), | ||
setup = quote({ | ||
L <- replicate(N, 1, simplify = FALSE) | ||
setDT(L) | ||
}), | ||
expr = quote({ | ||
data.table:::setattr(L, "class", NULL) | ||
data.table:::setDT(L) | ||
}), | ||
Slow = "c4a2085e35689a108d67dacb2f8261e4964d7e12", # Parent of the first commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/commit/7cc4da4c1c8e568f655ab5167922dcdb75953801) | ||
Fast = "1872f473b20fdcddc5c1b35d79fe9229cd9a1d15") # Last commit in the PR that fixes the issue (https://github.com/Rdatatable/data.table/pull/5427/commits) | ||
"setDT improved in #5427" = atime::atime_test( | ||
N = 10^seq(1, 7), | ||
setup = { | ||
L <- replicate(N, 1, simplify = FALSE) | ||
setDT(L) | ||
}, | ||
expr = { | ||
data.table:::setattr(L, "class", NULL) | ||
data.table:::setDT(L) | ||
}, |
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 re-indenting to the correct level
"memrecycle regression fixed in #5463" = atime::atime_test( | ||
N = 10^seq(3, 8), | ||
setup = quote({ | ||
setup = { | ||
n <- N/100 | ||
set.seed(2L) | ||
dt <- data.table( | ||
g = sample(seq_len(n), N, TRUE), | ||
x = runif(N), | ||
key = "g") | ||
dt_mod <- copy(dt) | ||
}), | ||
expr = quote(data.table:::`[.data.table`(dt_mod, , N := .N, by = g)), |
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.
using atime_test, quote is no longer needed in setup, nor expr
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.
Sweet!
.ci/atime/tests.R
Outdated
"shallow regression fixed in #4440" = list( | ||
pkg.edit.fun = pkg.edit.fun, | ||
pkg.edit.fun = pkg.edit.fun, |
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.
using atime_test_list, pkg.edit.fun now can now be defined once here, and then shared among all tests
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.
Looks like it isn't being detected:
Error in atime::atime_pkg(Sys.getenv("GITHUB_WORKSPACE"), tests.dir = ".ci") :
object 'pkg.edit.fun' not found
Calls: <Anonymous> -> do.call -> <Anonymous>
Execution halted
(I tested it on my fork with these changes and got the same too)
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.
Seems to be an issue with the scope (defining the function inside the atime::atime_test_list
call fixed it for me on my fork)
Looks great, nice improvement! PS reminder to update the PR description before submitting 👍 |
# | ||
# @return None (performs in-place file modifications) | ||
# @note This setup is typically unnecessary for most packages but essential for data.table due to its unique configuration. | ||
pkg.edit.fun = function(old.Package, new.Package, sha, new.pkg.path) { |
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.
moved pkg.edit.fun inside test.list, and fixed indentation
This PR refactors performance tests to reduce repetition.
new atime_test() lets us avoid using quote() in each setup/expr.
new atime_test_list() lets us avoid repeating the same pkg.edit.fun for each performance test.