[R] Which language is faster for numerical computation?

Hadley Wickham hadley at rice.edu
Fri Sep 10 17:35:12 CEST 2010


On Fri, Sep 10, 2010 at 10:23 AM, Henrik Bengtsson <hb at stat.berkeley.edu> wrote:
> Don't underestimate the importance of the choice of the algorithm you
> use.  That often makes a huge difference.  Also, vectorization is key
> in R, and when you use that you're really up there among the top
> performing languages.  Here is an example from the official R wiki
> illustrating my points:
>
>  http://rwiki.sciviews.org/doku.php?id=tips:programming:code_optim2
>
> My rule of thumb is:
>
> Any piece of code can be made twice as fast.

I second this point - the latest version of reshape is 100x faster in
some situations because I came up with a better vectorised algorithm -
it's still all in R.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list