> What are you doing the timing on?  On a modest desktop (2.6 GHz Athlon
> X4) I get less than a second for this
...
>> k <- matrix(runif(20* 20), ncol = 20)
>> system.time(convolve_2d(x, k))
>   user  system elapsed
>  0.864   0.000   0.862

Ooops, I must have been using a old k - I now get

> system.time(convolve_2d(x, k))
   user  system elapsed
  2.265   0.006   2.298

I'm on a 2nd gen macbook air, so the processor isn't the fastest (2.13
GHz). Maybe my intuition is wrong but it seems like you should be able
to do it faster than that.

But let me think - I'm doing 1000 * 1000 * 20 * 20 = 4e08 multiplies +
adds in ~2s.  So that's 5e-9 s = 5 ns per operation.  Looking at it
that way it does seem pretty fast already.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to