search for: addmemoization

Displaying 1 result from an estimated 1 matches for "addmemoization".

2012 Apr 26
2
Memoize and vectorize a custom function
...C)) user system elapsed 0.044 0.000 0.054 > > library(memoise) > GCm1 <- memoise(GC) > system.time(dummy <- sapply(rep(seqs,100), GCm1)) user system elapsed 0.164 0.000 0.173 > > library(R.cache) > GCm2 <- addMemoization(GC) > system.time(dummy <- sapply(rep(seqs,100), GCm2)) user system elapsed 10.601 0.252 10.926 Notice that the memoized functions are several orders of magnitude slower. I tried the `hash` package, but things seem to be happening behind the scenes and I don't unders...