-
Notifications
You must be signed in to change notification settings - Fork 72
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
Parallel styling #682
base: main
Are you sure you want to change the base?
Parallel styling #682
Conversation
Thanks @krlmlr. Couple of points (some also discussed in #277):
|
Codecov Report
@@ Coverage Diff @@
## master #682 +/- ##
==========================================
- Coverage 90.43% 90.15% -0.28%
==========================================
Files 47 47
Lines 2226 2234 +8
==========================================
+ Hits 2013 2014 +1
- Misses 213 220 +7
Continue to review full report at Codecov.
|
|
I see.
slow_sqrt <- function(xs) {
p <- progressor(along = xs)
future.apply::future_lapply(xs, function(x) {
message("Calculating the square root of ", x)
Sys.sleep(2)
p(sprintf("x=%g", x))
sqrt(x)
})
}
library(progressr)
handlers("progress")
with_progress(y <- slow_sqrt(1:10))
That said, I understand your point that 99% of the users probably don't want to bother with future strategies and progress bar settings but I think it's important to keep things transparent if possible. |
- simplify set_arg_paths (#682).
OK, I will try to finish this up. |
Thanks! Happy to review. The startup costs are a problem. On Linux we could start one child process with callr, which then could spawn subprocesses very efficiently with the multicore plan. We could do the same on Windows and multiprocess: In both cases this would also eliminate the problem of temporarily altering the local plan. What do you think? |
But going through another sub-process will probably not decrease the start-up costs, would it? Because on top of |
e8615e8
to
b79ff02
Compare
I thought about it again. There is an additional problem: When using future, setting a plan is time consuming, even when it's sequential. Hence, when there are less than 3 files to style and we don't set I think we should make a short vignette for this. |
via furrr.
Closes #277.
Closes #617 (=supersedes).
Things to consider:
/style
command in r-lib/actions.