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

Parallelise c14_calibrate_intcal() #13

Open
joeroe opened this issue Feb 4, 2022 · 1 comment
Open

Parallelise c14_calibrate_intcal() #13

joeroe opened this issue Feb 4, 2022 · 1 comment

Comments

@joeroe
Copy link
Owner

joeroe commented Feb 4, 2022

This is too slow:

library(p3k14c)
library(dplyr)
library(c14)

system.time({
  p3k14c_data |>
    mutate(cal = c14_calibrate(Age, Error))
})
#>    user  system elapsed 
#> 875.387   6.306 882.672
joeroe added a commit that referenced this issue Feb 4, 2022
@joeroe
Copy link
Owner Author

joeroe commented Feb 4, 2022

This is better!

library(p3k14c)
library(dplyr)
library(c14)
library(future)

plan(multisession)
system.time({
  p3k14c_data |>
    mutate(cal = c14_calibrate(Age, Error))
})
#>    user  system elapsed 
#> 143.702   1.838 236.875

Although I think a lot of the time spent there is actually in do.call(what = cal), so there's still room for improvement.

The use of future::plan() is not immediately obvious, so should probably add a section of a vignette on that at some point.

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