[R] Re: Vectorizing and R speed, follow-up

Thomas Lumley tlumley at u.washington.edu
Thu Aug 8 19:36:00 CEST 2002

On Thu, 8 Aug 2002, Jason Liao wrote:
> 3. I use Java for comparison because Java is also interpreted. Java
> started also very slow but has improved tremendously with introduction
> of just-in-time compiler and Hot spot. I am hoping that R will catch up
> so that we statisticians will no longer need to struggle with C,
> Fortran or Java.

I don't think it will. Java is byte-compiled (which makes quite a big
difference), and was designed from the ground up to be byte-compiled.  R
is much harder to optimise (as Luke Tierney will tell you), partly because
there are so many things that cannot be known until run-time.  Some Java
enthusiasts say that there is no reason in principle that Java should be
slower than C++. I don't think this is true for R.

In addition, there has probably been more programmer time spent on
optimising Java virtual machines than has been spent on writing all
statistical software ever.  This is partly a matter of resources but
partly that there are very few tasks in R where a 20% speedup would pay
off the effort required to achieve it.

I think it's reasonable to hope that there will be less and less need for
writing Fortran or even Java, but this will come partly because computers
will be faster and partly because the Fortran will already be written.


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list