On Sat, Jan 03, 2009 at 06:59:29PM +0100, Stefan Grosse wrote:
> On Sat, 3 Jan 2009 22:25:38 +0530 Ajay Shah <ajays...@mayin.org> wrote:
> 
> AS> system.time(for (i in 1:10000000) {a[i] <- a[i] + 1})
> 
> AS> I wonder what we're doing wrong!
> 
> it is no secret that R does badly with loops. Thats why it is
> recommended to use vectorized operations.

But there's a big difference even on the vectorised version: a <- a +
1. Why should that be? Both systems should merely be handing down to
the BLAS. The (stock) R install has a less carefully setup BLAS as
compared with the (stock) matlab install?

-- 
Ajay Shah                                      http://www.mayin.org/ajayshah  
ajays...@mayin.org                             http://ajayshahblog.blogspot.com
<*(:-? - wizard who doesn't know the answer.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to