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 discovered that fs::path_file and fs::path_dir run very slowly on windows (see fs issue 424), and since most of my use case of these functions is after using readr::read_csv(files, .id="file_path"), most of the vector is duplication. As such, I found that I could save a significant amount of time by deduplicating the vector (2x on Mac, 40x on Windows). This approach is not just helpful for fs::path_ functions.
As far as I can tell, memoise acts on the input to the function, not on the individual elements in the input. However, I do think it's a good idea to add this capability into memoise directly, and will suggest this idea there:
I discovered that
fs::path_file
andfs::path_dir
run very slowly on windows (seefs
issue 424), and since most of my use case of these functions is after usingreadr::read_csv(files, .id="file_path")
, most of the vector is duplication. As such, I found that I could save a significant amount of time by deduplicating the vector (2x on Mac, 40x on Windows). This approach is not just helpful forfs::path_
functions.The most straightforward approach is:
I've also submitted a PR into
vctrs
to speed this up (seevctrs
issue 1857 and PR 1858).I'm not sure where this helper should live, but since it's an extension of functional programming, I think it would make sense to be in
purrr
.The text was updated successfully, but these errors were encountered: