You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m not sure if something changed due to recent versions of R or if the version of RStudio plays a role here, but check_dots_empty0() seems very slow to me when ... are not empty.
library(rlang)
f<-function(x, ..., foofy=8) {
check_dots_empty0(...)
x+foofy
}
try(f(1, 4))
#> Error in f(1, 4) : `...` must be empty.#> ✖ Problematic argument:#> • ..1 = 4#> ℹ Did you forget to name an argument?
Note that when I run this benchmark interactively and not in reprex I get a timing around 200ms for rlang_error.
Here’s a small function I used to do the same in base. There are probably features missing compared to check_dots_empty0(), it’s just to get an idea of the performance:
Our error paths are not particularly optimised. Part of the overhead you're measuring is from our abort() and cli stack (try using abort() instead of stop() in your benchmark). The rest of this overhead might be worth taking a look.
I’m not sure if something changed due to recent versions of R or if the version of RStudio plays a role here, but
check_dots_empty0()
seems very slow to me when...
are not empty.Note that when I run this benchmark interactively and not in
reprex
I get a timing around 200ms forrlang_error
.Here’s a small function I used to do the same in base. There are probably features missing compared to
check_dots_empty0()
, it’s just to get an idea of the performance:I’d just like to know if someone can reproduce those timings and whether this is normal.
Session info
RStudio version: RStudio 2024.04.1+748 "Chocolate Cosmos" Release (3ada7c6ddc8fcdb86a727a4f0ae467b9d9a7296c, 2024-05-07) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.1+748 Chrome/120.0.6099.291 Electron/28.2.6 Safari/537.36, Quarto 1.4.550 (C:/Users/etienne/AppData/Local/Programs/Quarto/bin/quarto.exe)
The text was updated successfully, but these errors were encountered: