[R] fastest R platform: follow-up and summary

Luke Tierney luke at nokomis.stat.umn.edu
Tue Apr 17 13:26:48 CEST 2001

On Mon, Apr 16, 2001 at 08:13:38PM -0700, Jason Liao wrote:
> 4. profiling of the program.
> This was suggested by Profs. Ripley, Bates, Lumley and Andy Liaw. But
> according to Prof. Ripley, it can only be done on unix system. For my
> program I knew the bottleneck. It was just hard to break it.

Might still be worth a try.  I ran the profiler on this example in R
1.2.1 and found that around 90% of the time was in the call to outer.
Outer is quite a general function and doesn't perform as well as it
might in this special case.  If you use the R code analogous to your
ox code, that is replace

    sum <- sum + outer(ran, ran);	  


   sum <- sum + ran %*% t(ran);

then I get a factor of 7 speedup in this example.  That still leaves
it about 25 times slower than Ox, but it is certainly a worthwhile

[I believe 1.3 should include an improved version of outer, but the
current version only has the potential of about a factor of 2 speedup
in this example; don't know if we'll get a chance to tune it further
before 1.3 is released, but this example does show that further tuning
would be useful.]


Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      luke at stat.umn.edu
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu
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