Skip to content

Instantly share code, notes, and snippets.

@twittoru
Created November 12, 2011 06:47
Show Gist options
  • Save twittoru/1360158 to your computer and use it in GitHub Desktop.
Save twittoru/1360158 to your computer and use it in GitHub Desktop.
Tsukuba.R#9 appendix1
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 1.49133333333333
2400x2400 normal distributed random matrix ^1000____ (sec): 0.720333333333333
Sorting of 7,000,000 random values__________________ (sec): 1.13333333333333
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 19.3946666666667
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 8.623
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 2.44266320884065
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 0.816333333333333
Eigenvalues of a 640x640 random matrix______________ (sec): 1.31733333333333
Determinant of a 2500x2500 random matrix____________ (sec): 5.24366666666667
Cholesky decomposition of a 3000x3000 matrix________ (sec): 6.48833333333333
Inverse of a 1600x1600 random matrix________________ (sec): 5.32899999999999
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 3.32653547521042
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.17899999999999
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.735666666666665
Grand common divisors of 400,000 pairs (recursion)__ (sec): 3.47299999999998
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.34400000000001
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.951999999999998
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.14687655313092
Total time for all 15 tests_________________________ (sec): 58.241
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 2.10437988311317
--- End of test ---
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 4.56066666666667
2400x2400 normal distributed random matrix ^1000____ (sec): 0.707333333333333
Sorting of 7,000,000 random values__________________ (sec): 1.09066666666667
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 3.93266666666667
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 1.97433333333333
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 2.03829271260761
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 0.791333333333332
Eigenvalues of a 640x640 random matrix______________ (sec): 0.786666666666667
Determinant of a 2500x2500 random matrix____________ (sec): 1.78866666666666
Cholesky decomposition of a 3000x3000 matrix________ (sec): 1.69266666666666
Inverse of a 1600x1600 random matrix________________ (sec): 1.50366666666667
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.26287633384701
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.13533333333333
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.743333333333335
Grand common divisors of 400,000 pairs (recursion)__ (sec): 4.21633333333333
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.23666666666668
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.717999999999989
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.01434700379438
Total time for all 15 tests_________________________ (sec): 26.8783333333333
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 1.37701279516068
--- End of test ---
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 1.89
2400x2400 normal distributed random matrix ^1000____ (sec): 0.750333333333333
Sorting of 7,000,000 random values__________________ (sec): 1.087
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 2.55766666666667
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 1.28533333333333
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.38219411518791
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 0.851999999999999
Eigenvalues of a 640x640 random matrix______________ (sec): 0.859
Determinant of a 2500x2500 random matrix____________ (sec): 1.13533333333333
Cholesky decomposition of a 3000x3000 matrix________ (sec): 1.03333333333333
Inverse of a 1600x1600 random matrix________________ (sec): 1.20533333333333
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.00257990871748
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.12033333333333
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.736000000000004
Grand common divisors of 400,000 pairs (recursion)__ (sec): 4.667
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.34633333333333
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.982
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.13990969663045
Total time for all 15 tests_________________________ (sec): 21.507
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 1.16462514246633
--- End of test ---
#!/bin/zsh
# OSX 2.13 公式バイナリ
# GotoBLAS 1.13
wget http://r.research.att.com/benchmarks/R-benchmark-25.R
Rscript R-benchmark-25.R > netlib.log
#curl http://cms.tacc.utexas.edu/fileadmin/images/GotoBLAS2-1.13_bsd.tar.gz | tar zxf - && cd GotoBLAS2 && make
# install yourself
libgoto2=~/Downloads/GotoBLAS2//exports/libgoto2_penrynp-r1.13.dylib
DYLD_FORCE_FLAT_NAMESPACE=YES \
DYLD_INSERT_LIBRARIES=$libgoto2 Rscript R-benchmark-25.R > gotoblas.log
DYLD_FORCE_FLAT_NAMESPACE=YES \
DYLD_INSERT_LIBRARIES=$(R RHOME)/lib/libRblas.vecLib.dylib Rscript R-benchmark-25.R > veclib.log
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 1.37366666666667
2400x2400 normal distributed random matrix ^1000____ (sec): 0.459666666666667
Sorting of 7,000,000 random values__________________ (sec): 1.37133333333333
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 2.63933333333334
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 1.48266666666667
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.40828095280831
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 1.883
Eigenvalues of a 640x640 random matrix______________ (sec): 3.68466666666666
Determinant of a 2500x2500 random matrix____________ (sec): 1.55066666666667
Cholesky decomposition of a 3000x3000 matrix________ (sec): 1.594
Inverse of a 1600x1600 random matrix________________ (sec): 1.82233333333333
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.76193068354686
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.235
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.834333333333333
Grand common divisors of 400,000 pairs (recursion)__ (sec): 3.88533333333333
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.43633333333333
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 1.53999999999999
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.39791566821055
Total time for all 15 tests_________________________ (sec): 26.7923333333333
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 1.51374608264272
--- End of test ---
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 0.736666666666667
2400x2400 normal distributed random matrix ^1000____ (sec): 0.383666666666667
Sorting of 7,000,000 random values__________________ (sec): 1.00633333333333
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 21.1103333333333
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 9.352
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.90680284751702
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 1.221
Eigenvalues of a 640x640 random matrix______________ (sec): 1.70966666666666
Determinant of a 2500x2500 random matrix____________ (sec): 8.26466666666667
Cholesky decomposition of a 3000x3000 matrix________ (sec): 6.66799999999999
Inverse of a 1600x1600 random matrix________________ (sec): 8.11933333333332
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 4.52351257862461
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 0.991999999999981
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.571333333333352
Grand common divisors of 400,000 pairs (recursion)__ (sec): 2.93666666666667
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.14533333333335
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.787000000000035
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 0.963398801386631
Total time for all 15 tests_________________________ (sec): 65.004
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 2.02548593564271
--- End of test ---
#!/bin/zsh
# demo でやる予定だったやつ 出力例が output.txt
libgoto2=~/Downloads/GotoBLAS2//exports/libgoto2_penrynp-r1.13.dylib
BENCH=$(tempfile)
cat <<EOF > $BENCH
library(rbenchmark)
hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
x <- hilbert(1000) #from help(svd)
bench <- benchmark(svd(x),x%*%x,replications=3,columns=c("test","elapsed"))
print(bench)
EOF
echo "標準 Netlib"
echo
Rscript $BENCH
echo "GotoBLAS"
echo
DYLD_FORCE_FLAT_NAMESPACE=YES \
DYLD_INSERT_LIBRARIES=$libgoto2 Rscript $BENCH
echo "built-in vecLib"
echo
DYLD_FORCE_FLAT_NAMESPACE=YES \
DYLD_INSERT_LIBRARIES=$(R RHOME)/lib/libRblas.vecLib.dylib Rscript $BENCH
rm $BENCH
標準 Netlib
test elapsed
1 svd(x) 19.373
2 x %*% x 5.777
GotoBLAS
test elapsed
1 svd(x) 6.243
2 x %*% x 0.738
built-in vecLib
test elapsed
1 svd(x) 7.633
2 x %*% x 0.697
#/bin/zsh
# さくらVPS での revolution ベンチ
suto apt-get install r-base revolution-mkl
wget http://r.research.att.com/benchmarks/R-benchmark-25.R
<<EOF < R-benchmark-25.R | Rscript - > benchmark-revolution-1core.log
library(Revobase)
setMKLthreads(1)
EOF
<<EOF < R-benchmark-25.R | Rscript - > benchmark-revolution-1core.log
library(Revobase)
setMKLthreads(1)
EOF
sudo apt-get revolution-mkl
R-benchmark-25.R | Rscript - > benchmark-bare-r.log
R Benchmark 2.5
===============
Number of times each test is run__________________________: 3
I. Matrix calculation
---------------------
Creation, transp., deformation of a 2500x2500 matrix (sec): 0.738333333333333
2400x2400 normal distributed random matrix ^1000____ (sec): 0.382
Sorting of 7,000,000 random values__________________ (sec): 1.03733333333333
2800x2800 cross-product matrix (b = a' * a)_________ (sec): 2.492
Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 1.579
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.06541215317528
II. Matrix functions
--------------------
FFT over 2,400,000 random values____________________ (sec): 1.12633333333333
Eigenvalues of a 640x640 random matrix______________ (sec): 1.24333333333334
Determinant of a 2500x2500 random matrix____________ (sec): 1.48766666666667
Cholesky decomposition of a 3000x3000 matrix________ (sec): 1.46
Inverse of a 1600x1600 random matrix________________ (sec): 1.43533333333333
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 1.37604002954527
III. Programmation
------------------
3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.05066666666667
Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.667666666666662
Grand common divisors of 400,000 pairs (recursion)__ (sec): 3.19566666666666
Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 1.23033333333333
Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.676999999999992
--------------------------------------------
Trimmed geom. mean (2 extremes eliminated): 0.956515776941741
Total time for all 15 tests_________________________ (sec): 19.8026666666667
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 1.11930115190358
--- End of test ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment