Skip to content
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

Investigate using furrr package (perform purrr functions in parallel) #127

Open
jack89roberts opened this issue Jul 30, 2019 · 0 comments
Open

Comments

@jack89roberts
Copy link
Contributor

jack89roberts commented Jul 30, 2019

Has anyone come across/considered furrr before? It implements purrr functions in parallel. May be low hanging fruit to get performance gains wherever purrr::map is used in the package.

Also claims to work on Windows, r.e. #53

Repo: https://github.com/DavisVaughan/furrr

E.g. quick test using the VRPINS graphs (in inst/extdat) gives at least 7 times speedup of netdis_centred_graphlet_counts on my 8 core iMac.

Original (takes ~3.5 seconds):

centred_counts <- purrr::map(query_graphs, netdis_centred_graphlet_counts,
                             max_graphlet_size = max_graphlet_size, 
                             neighbourhood_size = neighbourhood_size,
                             expected_ego_count_fn = expected_count_fn)

With furrr (takes ~0.5 seconds):

library(furrr)
plan(multiprocess)

centred_counts <- future_map(query_graphs, netdis_centred_graphlet_counts,
                             max_graphlet_size = max_graphlet_size, 
                             neighbourhood_size = neighbourhood_size,
                             expected_ego_count_fn = expected_count_fn)

NB: The default plan is to run sequentially, in which case it runs the same as purrr::map. Recommendation is to leave setting the plan to the user: https://www.rdocumentation.org/packages/future/versions/1.14.0/topics/plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant