-
-
Save revodavid/1821f38ee98dd4ab3eae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run Simon Urbanek's benchmark v2.5 | |
cat("R version\n") | |
cat("=========\n") | |
print(R.version) | |
if(exists("Revo.version")) { | |
cat("Revo version") | |
cat("============") | |
print(Revo.version) | |
} | |
totalTestTime <- system.time({ | |
source(url("http://r.research.att.com/benchmarks/R-benchmark-25.R")) | |
}) | |
cat("Total test time:", totalTestTime[[3]], "seconds") | |
## Nick's benchmark script | |
library(Revobase) | |
runMKLBenchmarks<-function() | |
{ | |
cat("MKL Threads being used: ", getMKLthreads(), "\n") | |
cat("Matrix Multiply\n") | |
set.seed (1) | |
m <- 10000 | |
n <- 5000 | |
A <- matrix (runif (m*n),m,n) | |
print(system.time (B <- crossprod(A))) | |
cat("Cholesky Factorization\n") | |
print(system.time (C <- chol(B))) | |
cat("Singular Value Deomposition\n") | |
m <- 10000 | |
n <- 2000 | |
A <- matrix (runif (m*n),m,n) | |
print(system.time (S <- svd (A,nu=0,nv=0)) ) | |
cat("Principal Components Analysis\n") | |
m <- 10000 | |
n <- 2000 | |
A <- matrix (runif (m*n),m,n) | |
print(system.time (P <- prcomp(A)) ) | |
cat("Linear Discriminant Analysis\n") | |
require ('MASS') | |
g <- 5 | |
k <- round (m/2) | |
A <- data.frame (A, fac=sample (LETTERS[1:g],m,replace=TRUE)) | |
train <- sample(1:m, k) | |
print(system.time (L <- lda(fac ~., data=A, prior=rep(1,g)/g, subset=train))) | |
} | |
getMKLthreads() | |
runMKLBenchmarks() | |
setMKLthreads(1) | |
runMKLBenchmarks() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment