From: "Yoon, Hoon (CICG - NY Program Trading)" <HYoon@exchange.ml.com>
To: r-help@stat.math.ethz.ch
Subject: [R] Benchmark
Date: Tue, 1 Dec 1998 12:34:31 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01BE1D51.0FDBBFAE
Content-Type: text/plain;
charset="ISO-8859-1"
Hello:
I modified benchmark used in
http://www.informatik.uni-frankfurt.de/~stst/benchspl.txt now the attached
code will work with R, except for last test for some reason (Sorry ran out
of time to play with this).
Immediate problem is that R does not show fraction of seconds. So, that
kinda makes comparison some what hard. I also looked at memory and CPU usage
on NT console. R seems to go into hybernation when not focused. The results
are mixed. I am sure if I add something complicated or/and loops that Splus
will slow down to crawl.
Another interesting thing is that the random generator on Splus is a
rocket.
I had many things running on the computer while trying to do this, so I am
very confident about results.
Has anyone done something similar? If so let me know.
**************************************************************
S. Hoon Yoon (Quant) Merrill Lynch
Equity Trading
yelled@yahoo.com hoon@bigfoot.com(w)
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages." Maudin
**************************************************************
This was for Splus 4.5 on Pentium Pro 200, 256MB Compaq 2000 Ultra SCSI
I had a lot of stuff running concurrently, but shows some indication.
[1] "!!! S-Plus and R - Benchmarkprogram !!!"
[1] "================================"
[1] ""
[1] "If you use R, then do |R> dos.time <- system.time"
[1] " R does not currently show fraction of sec."
[1] " Modified Stefan's work by S. Hoon Yoon on Dec 1, 1998"
[1] " Visit his web site at
http://www.informatik.uni-frankfurt.de/~stst/benchspl.txt"
[1] " He has same bench for Gauss, Mathlab, Splus, Ox, etc... "
[1] ""
[1] ""
[1] "400 x 400 random matrix^1000 (sec.) : "
[1] 0.1899414
[1] "Eigenval. of a 300 x 300 randommatrix (sec.) :"
[1] 58.55005
[1] "Inverse of a 500 x 500 random matrix (sec.) :"
[1] 50.16992
[1] "500000 values sorted ascending (sec.) :"
[1] 2.800049
[1] "800 x 800 Toeplitzmatrix (sec.) :"
[1] 3.430176
[1] "Cholesky decomposition of a 500 x 500 -matrix (sec.) :"
[1] 5.599854
[1] "500 x 500 cross-product matrix (sec.) :"
[1] 20.11987
[1] "FFT over 100000 values (sec.) :"
[1] 1.379883
[1] "Gaussian error function over a 100000 x 100000 matrix (sec.) :"
[1] "Gamma function over a 600 x 600 matrix (sec.) :"
[1] 2.290039
[1] "Linear regression over a 500 x 500 matrix (sec.) :"
[1] 18.41016
R same machine
> source("H:/Splus/benchr.txt")
[1] "!!! S-Plus and R - Benchmarkprogram !!!"
[1] "================================"
[1] ""
[1] "If you use R, then do |R> dos.time <- system.time"
[1] " R does not currently show fraction of sec."
[1] " Sure would appreciate someone contributing that code"
[1] " Also interesting will be loop test and mem usage meter"
[1] " Modified Stefan's work by S. Hoon Yoon on Dec 1, 1998"
[1] " Visit his web site at
http://www.informatik.uni-frankfurt.de/~stst/benchspl.txt"
[1] " He has same bench for Gauss, Mathlab, Splus, Ox, etc... "
[1] ""
[1] ""
[1] "400 x 400 random matrix^1000 (sec.) : "
[1] NA NA 5 NA NA
[1] "Eigenval. of a 300 x 300 random matrix (sec.) :"
[1] NA NA 31 NA NA
[1] "Inverse of a 500 x 500 random matrix (sec.) :"
[1] NA NA 99 NA NA
[1] "5e+005 values sorted ascending (sec.) :"
[1] NA NA 21 NA NA
[1] "800 x 800 Toeplitzmatrix (sec.) :"
[1] NA NA 4 NA NA
[1] "Cholesky decomposition of a 500 x 500 -matrix (sec.) :"
[1] NA NA 2 NA NA
[1] "500 x 500 cross-product matrix (sec.) :"
[1] NA NA 16 NA NA
[1] "FFT over 1e+005 values (sec.) :"
[1] NA NA 1 NA NA
[1] "Gaussian error function over a 1e+005 x 1e+005 matrix (sec.) :"
[1] "Gamma function over a 600 x 600 matrix (sec.) :"
[1] NA NA 1 NA NA
[1] "Linear regression over a 500 x 500 matrix (sec.) :"
Error: 500 responses, but only 501 variables
Timing stopped at: NA NA 0 NA NA
<<benchr.txt>>
------_=_NextPart_000_01BE1D51.0FDBBFAE
Content-Type: text/plain;
name="benchr.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="benchr.txt"
Content-Location: ATT-0-89A738264489D21195BC0001FA7E827B-b
enchr.txt
print("!!! S-Plus and R - Benchmarkprogram !!!")=0A=
print("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D")=0A=
print('')=0A=
print("If you use R, then do |R> dos.time <- system.time")=0A=
print(" R does not currently show fraction of sec.")=0A=
print(" Sure would appreciate someone contributing that code")=0A=
print(" Also interesting will be loop test and mem usage meter")=0A=
print(" Modified Stefan's work by S. Hoon Yoon on Dec 1, 1998")=0A=
print(" Visit his web site at =
http://www.informatik.uni-frankfurt.de/~stst/benchspl.txt")=0A=
print(" He has same bench for Gauss, Mathlab, Splus, Ox, etc... ")=0A=
print('')=0A=
print('')=0A=
=0A=
seed <- 400=0A=
print(paste(seed, "x", seed, "random matrix^1000 (sec.) : "))=0A=
print(dos.time(matrix(runif(seed*seed),seed,seed)))=0A=
=0A=
seed <- 300=0A=
print(paste("Eigenval. of a ", seed, "x", seed, "random matrix (sec.) =
:"))=0A=
x<-matrix(runif(seed*seed),seed,seed)=0A=
print(dos.time(eigen(x)))=0A=
=0A=
seed <- 500=0A=
print(paste("Inverse of a ", seed, "x", seed, " random matrix (sec.) =
:"))=0A=
x<-matrix(runif(seed*seed),seed,seed)=0A=
print(dos.time(solve(x)))=0A=
=0A=
print(paste(seed*1000, " values sorted ascending (sec.) :"))=0A=
x<-runif(seed*1000)=0A=
print(dos.time(sort(x)))=0A=
=0A=
seed <- 800=0A=
print(paste(seed, "x", seed, "Toeplitzmatrix (sec.) :"))=0A=
"top" <-=0A=
function (n =3D 4) =0A=
{=0A=
mat <- matrix(ncol =3D n, nrow =3D n, byrow =3D F)=0A=
mat[, 1] <- 1:n=0A=
mat[, n] <- n:1=0A=
for (i in seq(2, n - 1)) mat[, i] <- c(seq(i, 1), seq(2, n - i =
+ 1))=0A=
mat=0A=
}=0A=
print(dos.time(top(seed)))=0A=
=0A=
seed <- 500=0A=
print(paste("Cholesky decomposition of a", seed, "x", seed, "-matrix =
(sec.) :"))=0A=
x<-matrix(runif(seed*seed),seed,seed)=0A=
x<-crossprod(x,x)=0A=
print(dos.time(chol(x)))=0A=
=0A=
print(paste(seed, "x", seed, "cross-product matrix (sec.) :"))=0A=
x<-matrix(runif(seed*seed),seed,seed)=0A=
print(dos.time(crossprod(x,x)))=0A=
=0A=
seed <- 100000=0A=
print(paste("FFT over", seed, "values (sec.) :"))=0A=
x<-runif(seed)=0A=
print(dos.time(fft(x)))=0A=
=0A=
print(paste("Gaussian error function over a", seed, "x", seed, "matrix =
(sec.) :"))=0A=
=0A=
seed <- 600=0A=
print(paste("Gamma function over a ", seed, "x", seed, " matrix (sec.) =
:"))=0A=
x<-matrix(runif(360000),600,600)=0A=
print(dos.time(gamma(x)))=0A=
=0A=
seed <- 500=0A=
print(paste("Linear regression over a", seed, "x", seed, "matrix (sec.) =
:"))=0A=
x<-matrix(runif(250000),500,500)=0A=
y<-runif(500)=0A=
print(dos.time(lsfit(x,y)))=0A=
------_=_NextPart_000_01BE1D51.0FDBBFAE--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._