Skip to content
Prev 40691 / 63424 Next

[datatable-help] speeding up perception

Simon (and all),

I've tried to make assignment as fast as calling `[<-.data.table`
directly, for user convenience. Profiling shows (IIUC) that it isn't
dispatch, but x being copied. Is there a way to prevent '[<-' from
copying x?  Small reproducible example in vanilla R 2.13.0 :
[1] "<0xa1ec758>"
tracemem[0xa1ec758 -> 0xa1ec558]:    # but, x is still copied, why?
I've tried returning NULL from [<-.newclass but then x gets assigned
NULL :
tracemem[0xa1ec558 -> 0x9c5f318]:
NULL
Any pointers much appreciated. If that copy is preventable it should
save the user needing to use `[<-.data.table`(...) syntax to get the
best speed (20 times faster on the small example used so far).

Matthew
On Tue, 2011-07-05 at 08:32 +0100, Matthew Dowle wrote: