-
Notifications
You must be signed in to change notification settings - Fork 186
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
Investigate possible slowdown vs 3.0.2 #1983
Comments
Some insights: linter-level comparison, among the linters present on both
Ran this twice, and the first time (not saved here) old was faster than new (vs here new is faster), so I think it's up to timing noise. I'm happy to chalk up the timing difference to the difference in linters between the two versions:
Of course As one last insight, I timed
In conclusion, I feel comfortable about my initial hypothesis, namely that the major timing differences on the two branches can be attributed to changes in the set of linters used, especially library(lintr)
both <- sort(c("brace_linter", "commas_linter", "equals_na_linter", "function_left_parentheses_linter",
"infix_spaces_linter", "line_length_linter", "object_length_linter",
"object_name_linter", "object_usage_linter", "paren_body_linter",
"pipe_continuation_linter", "semicolon_linter", "seq_linter",
"spaces_inside_linter", "spaces_left_parentheses_linter", "T_and_F_symbol_linter",
"trailing_blank_lines_linter", "trailing_whitespace_linter",
"vector_logic_linter"))
both_funs <- lapply(both, \(f) eval(call(f), envir = asNamespace("lintr")))
names(both_funs) <- both
info <- vector("list", length(both))
names(info) <- both
for (linter in both) {
info[[linter]]$timing <- suppressMessages(system.time({
info[[linter]]$lints <- lint_package(linters = both_funs[[linter]], parse_settings = FALSE)
}))
}
# linter-level timings
cbind(
n_lints = sapply(info, \(x) length(x$lints)),
time_elapsed = sapply(info, `[[`, c("timing", "elapsed"))
)
# copy-paste output as a string 'str', or in current session use
# data.table::as.data.table(cbind(...), keep.rownames="linter")
new_data = str |>
strspit("\n") |>
unlist() |>
strsplit("\\s+") |>
data.table::transpose() |>
data.table::setDT() |>
data.table::setnames(c("linter", "n_lints", "time_elapsed"))
data = merge(old_data, new_data, by = "linter", suffixes = c("_old", "_new"))
data[, time_delta := time_elapsed_new - time_elapsed_old]
data[, time_delta_pct := 100 * time_delta / time_elapsed_old] |
See report:
#1476 (comment)
The text was updated successfully, but these errors were encountered: