Hello, I take this back, wrong implementation of the experiment. Sorry for the noise.
Regards Saptarshi On Sun, Aug 15, 2010 at 12:22 PM, Saptarshi Guha <saptarshi.g...@gmail.com> wrote: > Hello, > I have question about the overhead in lapply. > x is a list of 3000 lists. Each of the i (1<=i<=3000) list elements is > pair of two elements: a string vector and a data frame > > x is roughly 235MB. > >> gc() > ## > >> z <- system.time(y <- lapply(x,function(r){ > system.time(serialize(r,NULL))['elapsed'] > })) >> sum(unlist(y)) > 18.812 >> z > user system elapsed > 494.144 0.041 494.247 > > So, the entire lapply takes ~26 times longer than the sum of the > individual operations. > > Have i missed something? > > Regards > Saptarshi > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.