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 believe this is an unexplored performance issue, seemingly relating to dplyr::expand_across
Benchmarked over a 1000 repetitions of processing ames data; There is a marked difference between direct mutation, and indirect mutation faciliated by across , seemingly both when using where() selection, and explicit all_of(c(..)) style selection. The latter speed degredation (of direct listing through all_of(c(...)) I think shows that the issue wont be related to checking properties a la the where() instant.
I think the performance issue is significant, with direct mutation approx 3x faster than that mediated by across
I came across and considered whether this was related to #6897; however I believe it is something else.
Here when using across I use the anonymous function syntax as advised.
Hi, I'm not a dplyr dev (or a tidyverse dev at all), but I'm not sure what you expect here. across() simply has to do more operations since it must evaluate the tidy selection passed in .cols and there are probably other checks and steps that need to be done. Note that the across() call with where() is the slowest because it must evaluate the condition on all columns and retain only those where this condition is true.
Moreover, this timing difference barely scales with the number of rows and columns in the data (except for where() that increases with the number of columns). On my machine, the difference is always 3-4ms. I don't think this overhead is important, but if it is in your case maybe you should consider alternative packages like data.table that are built for performance.
I believe this is an unexplored performance issue, seemingly relating to dplyr::expand_across
Benchmarked over a 1000 repetitions of processing ames data; There is a marked difference between direct mutation, and indirect mutation faciliated by across , seemingly both when using
where()
selection, and explicit all_of(c(..)) style selection. The latter speed degredation (of direct listing through all_of(c(...)) I think shows that the issue wont be related to checking properties a la the where() instant.I think the performance issue is significant, with direct mutation approx 3x faster than that mediated by across
I came across and considered whether this was related to #6897; however I believe it is something else.
Here when using across I use the anonymous function syntax as advised.
first a reprex and then my session info...
session info
The text was updated successfully, but these errors were encountered: