[R] time of serialization

Saptarshi Guha saptarshi.guha at gmail.com
Sun Aug 15 18:22:58 CEST 2010


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



More information about the R-help mailing list