I've recently discovered the dramatic performance improvements 
data.table provides over ddply() and merge(), and I'm looking forward to
 integrating it into my work.  While messing around with benchmarks, I 
ran into an unexpected outcome with cbind(), where operations are 
actually much faster with data frames than data tables.  Don't ask my 
why I'd ever do the following, but I am curious as to why it is so much 
slower:

USArrests.dt <- data.table(USArrests)
lst.USArrests <- replicate(1000, USArrests, simplify=FALSE)
lst.USArrests.dt <- replicate(1000, USArrests.dt, simplify=FALSE)

microbenchmark(do.call(cbind, lst.USArrests),
               do.call(cbind, lst.USArrests.dt),
               times=10)
Unit: milliseconds
                             expr       min        lq    median        uq       
max neval
    do.call(cbind, lst.USArrests)  42.26891  47.70086  48.71271  49.88542  
51.25453    10
 do.call(cbind, lst.USArrests.dt) 750.70469 761.70511 773.91232 816.85707 
880.45896    10
This is run on an Ubuntu system.                                          
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to