-
Notifications
You must be signed in to change notification settings - Fork 9
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
Slow startup with make_cluster()
on Apple aarch64
#123
Comments
The Having said that, for the same R version on Linux on x86_64 (Ubuntu jammy) there is practically no difference in speed when I test your reprex above, so I can only assume that (as you mention) this is only for 'some platforms' i.e. aarch64-apple-darwin23.5.0. I have no particular insight as to this platform. EDIT: I've tested on Windows x86_64 and mirai is actually faster here as I guess the underlying implementation is more optimal than base R's on this platform. It may be possible to avoid by using the native mirai interface with |
make_cluster()
make_cluster()
on Apple aarch64
I see that I had a naive implementation that really did do launches synchronously... So now in #124 I launch all daemons asynchronously, and synchronize afterwards. On Linux, Thanks @mtmorgan for pointing this out, much appreciated - this will help not just those using the |
These are now approximately comparable on my machine > system.time(cl <- parallel::makePSOCKcluster(10)); parallel::stopCluster(cl)
user system elapsed
0.008 0.010 0.601
> system.time(m <- mirai::make_cluster(10))
user system elapsed
0.039 0.051 0.642 Thanks for looking into this. |
You're welcome. Thanks for posting an issue! |
A simple example shows that
parallel::makePSOCKcluster()
is 6x faster than mirai'smake_cluster()
on some platforms.I think this is because the PSOCK processes are launched asynchronously and then collected, whereas mirai's daemons are created strictly synchronously.
The text was updated successfully, but these errors were encountered: