We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
library(ggplot2) data(diamonds, package = "ggplot2") get_diamonds <- function(){ return(diamonds) } test_base <- function(){ unserialize(serialize(get_diamonds(), NULL)) } test_ascii <- function(){ unserialize(serialize(get_diamonds(), NULL, ascii = TRUE)) } test_dirk <- function(){ RApiSerialize::unserializeFromRaw(RApiSerialize::serializeToRaw(get_diamonds())) } test_sys <- function(){ sys::eval_safe(get_diamonds()) } test_parallel <- function(){ proc <- parallel::mcparallel(get_diamonds()) out <- parallel::mccollect(proc) parallel::mccollect(proc) out[[1]] } t1 <- test_base() t2 <- test_ascii() t3 <- test_dirk() t4 <- test_sys() t5 <- test_parallel() stopifnot(all.equal(t1, t2)) stopifnot(all.equal(t1, t3)) stopifnot(all.equal(t1, t4)) stopifnot(all.equal(t1, t5)) library(microbenchmark) microbenchmark( base = test_base(), ascii = test_ascii(), dirk = test_dirk(), sys = test_sys(), parallel = test_parallel(), times = 10 )
The text was updated successfully, but these errors were encountered:
OK the slowness is in unserialize.
Sorry, something went wrong.
Adding an Rprintf() statement to OutBytesCB and the slowness is completely gone. Another Heisenbug.
Rprintf()
OutBytesCB
Workaround for #19: serialize in R instead of C
e535a51
Maybe need to flush when writing to pipes?
No branches or pull requests
The text was updated successfully, but these errors were encountered: