Closed odelmarcelle closed 2 years ago
After some testing, it does not work as expected because ...future.FUN
is still evaluated with it's own environment. So it doesn't seem to make used of exported globals. I will look a bit for a way to solve that.
I don't see how to solve the issue safely for all possible usage of future.apply
. A satisfactory solution would probably require numerous changes to future.apply
and the cluster class of future
.
In the absence of an easy-to-implement solution, I'm closing this pull request. If future.apply
is not capable of efficiently stripping the unwanted function environment, it is up to the user to be careful about the environment of the provided function.
Related to #98. Reduce the amount of data transferred to other clusters by stripping the enclosing environment from the exported function. This drastically fastens the exportation to PSOCK clusters and does not seem to create any issue.
Benchmark before/after
Setup
Before changes
Created on 2022-03-12 by the reprex package (v2.0.1)
After changes