Skip to content

Overhead #2

@wlandau

Description

@wlandau

I am really happy to see future extend to so many forms of parallelism!

Is there anything we can do about overhead?

library(future.callr)
library(microbenchmark)
library(parallel)

n <- rep(1e2, 10)
f <- function(n){
  mean(rnorm(n))
}

options(mc.cores = 10)
x <- microbenchmark(mclapply(n, f))
plan(future.callr::callr)
y <- microbenchmark(future_lapply(n, f))
rbind(x, y)

## Unit: milliseconds
## expr       min          lq       mean     median         uq
## mclapply(n, f)    8.9127    9.696006   10.41556   10.39014   10.92663
## future_lapply(n, f) 2982.5224 3075.635802 3140.52041 3090.21414 3101.86924
## max neval cld
## 13.886   100  a
## 6304.660   100   b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions