Skip to content
Prev 10663 / 398502 Next

fastest R platform

The first step in performance tuning scientific code is to rewrite it so the
flow of control, especially the loop structure, is *crystal clear* and
obvious to the casual observer. Once you've done that, focus on the
innermost loops -- those sections that are executed on the order of the cube
of the problem size or higher. It is rare for scientific code to be higher
order than the cube of the problem size, although I've seen it in
computational chemistry.

Once you've isolated the spots that are being executed most often, try
replacing scalar operations with vector operations and vector operations
with matrix operations. These are usually translated fairly efficiently by
modern compilers, and special assembler level packages can be found for
things like the Basic Linear Algebra Subroutines (BLAS).

While there are faster things on the market than a 700 MHz Pentium, they
aren't cheap and aren't necessarily going to be a whole lot faster unless
you go to some effort in tuning your code. Fortunately, R allows linking
easily with major chunks of C or FORTRAN code. Again, the key is knowing
*precisely* where your code is spending its time.

--
M. Edward (Ed) Borasky, Chief Scientist, Borasky Research
http://www.borasky-research.net  http://www.aracnet.com/~znmeb
mailto:znmeb at borasky-research.com  mailto:znmeb at aracnet.com

If there's nothing to astrology, how come so many famous men were born on
holidays?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._