On 30 July 2013 at 11:26, Wush Wu wrote: | Thanks for your suggestion, Dirk.
Glad to have been of assistance. What you were trying to do (hold on to and shield a connection object), Modules are a very fine tool. | I'll try to rewrite Rhiredis based on your approach and provide a similar | rredis interface. If everything is good, I'll try to make it on CRAN if it is | possible. I'd be happy to help. The one thing it needs is a C-level access to serialization which would help with the overall speed gain. Right now we're not all that much faster than the rredis package. Below is a simple benchmark (which is part of my git repo 'rhiredis') that attempts to be honest in the comparison to rredis. Dirk library(rhiredis) library(rredis) library(rbenchmark) data(trees) fit <- lm(log(Volume) ~ log(Girth) + log(Height), data=trees) rawfit <- rawToChar(serialize(fit,NULL,ascii=TRUE)) redis <- new(Redis) rredis::redisConnect() hiredis <- function() redis$exec(paste("SET fits1 ", rawToChar(serialize(fit,NULL,ascii=TRUE)), sep="")) rredis <- function() rredis::redisSet("fits2", fit) res <- benchmark(hiredis(), rredis(), replications=100)[,1:4] print(res) all.equal(unserialize(charToRaw(redis$exec("GET fits1"))), fit) all.equal(rredis::redisGet("fits2"), fit) -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel