Skip to content
Prev 10757 / 398502 Next

fastest R platform: follow-up and summary

On Mon, Apr 16, 2001 at 08:13:38PM -0700, Jason Liao wrote:
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);	  

with

   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
improvement.

[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
Message-ID: <20010417062648.A3472@nokomis.stat.umn.edu>
In-Reply-To: <20010417031338.62670.qmail@web10506.mail.yahoo.com>; from jg_liao@yahoo.com on Mon, Apr 16, 2001 at 08:13:38PM -0700