[datatable-help] speed

carlsutton suttoncarl at ymail.com
Thu Oct 6 21:54:44 CEST 2016


I was doing a refresher on the Data Camp series on data table.  Under the set
function section I decided to do a system time to measure just how much
faster data table is than base R
x <- rep(1:5,1000000
y <- rep(c(1,8,1,1,1),1000000
z <= rep(1:5,1000000)
dt <- data.table(x,y,z)
system.time for (i in 1:length(x)) dt[i,z := i +1] user time was 2096.27
system.time for (i in 1:length(x)) set(dt,i,3L, i + 1) user time was 14.04

set was faster by 149.31 times!

Good going data.table guys and gals

Carl Sutton




-----
Carl Sutton
--
View this message in context: http://r.789695.n4.nabble.com/speed-tp4725391.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list