[R] time of serialization

Saptarshi Guha saptarshi.guha at gmail.com
Sun Aug 15 20:08:38 CEST 2010


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.guha at 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
>



More information about the R-help mailing list