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

Cache the R version and RNG kind? #170

Closed
wlandau opened this issue May 28, 2021 · 0 comments
Closed

Cache the R version and RNG kind? #170

wlandau opened this issue May 28, 2021 · 0 comments

Comments

@wlandau
Copy link

wlandau commented May 28, 2021

The targets package needs to call with_seed() a lot, and noticeable time is spent getting the R version and RNG kind. Would it be feasible to cache these in withr for the current R session? digest has a similar way of caching the platform type in a local package environment: eddelbuettel/digest#138.

To demonstrate the bottlenecks I see in with_seed():

proffer::pprof(replicate(10000, withr::with_seed(0, 1)))

Screen Shot 2021-05-28 at 12 22 06 PM

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