Steve,
Thank you.

arun, 
Could you run it with `microbenchmark` instead of system.time (with times = 100 
or so) and paste the results here?

Also, maybe you could use debugonce(data.table:::`[.data.table`) and then run 

    x[, .SD[.N], by='Date']

to go step by step to find out the line that causes the lag, perhaps? 


Arun


On Friday, August 16, 2013 at 9:01 AM, Steve Lianoglou wrote:

> Hi Arun,
> 
> On Thu, Aug 15, 2013 at 11:27 PM, Arunkumar Srinivasan
> <[email protected] (mailto:[email protected])> wrote:
> > Sorry, but I'm not sure what your question is here. There seems to be
> > different timings between you and Steve. You want to get it verified as to
> > which one is true? On my system, Steve's takes 0.003 seconds.
> > 
> 
> 
> Actually, the issue was that (as far as I could tell) his code and my
> code are exactly the same, but it runs orders of magnitude slower on
> his machine than anywhere else I could test.
> 
> It doesn't make any sense -- perhaps I'm not looking close enough, but
> I suggested he send it here so more eyes could see it, because I'm
> stumped as to why/how that could happen.
> 
> > However, a *faster* version than Steve's solution (on bigger data) would be:
> > 
> > x[x[, .I[.N], by='Date']$V1]
> 
> Hah! Well done ;-)
> 
> -steve
> 
> -- 
> Steve Lianoglou
> Computational Biologist
> Bioinformatics and Computational Biology
> Genentech
> 
> 


_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to