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

Bill Oliver wloliver at qwest.net
Tue Apr 17 18:51:26 CEST 2001

If the results from the benchmark below can be generalized, code involving
loops may run more efficiently under Win2k than under Windows 98 and Windows
ME. After upgrading from Windows 98 to Win2k, the benchmark below ran
roughly twice as quickly on the same machine.

test5 <- function (n) {
    k <- 0
    for (j in 1:n) {
        v <- c(1,2,j,j,3)
        if (v[2]==2) k <- k+1

This benchmark appears in a recent paper by Prof. Tierney and was originally
coded by Radford Neal.


I don't know why this particular benchmark takes less time under Win2k. Not
all R code will necessarily run in less time under Win2k. For example, the
bit of nonsense code below took about 92 seconds under Windows 98 and Win2k
on the same machine (600 MHz Pentium III, 256 MB).

n <- 1000
x <- matrix(runif(n*n),n)
system.time(sx <- sqrt(var(diag(x %*% solve(x)))))


"Jason Liao" <jg_liao at yahoo.com> wrote:
> To summarize: the forthcoming P4 1.70 MHz will be my next machine for
> runing R. Thanks again.

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