Revolutionary Performance—Speed up your R with Revolution R!

Performance Benchmarks

The benchmarks on this page demonstrate the performance of Revolution R 5.0 compared to the base version of R-2.13.2, available from the R Project. The test system was an Intel® Xeon® Processor X3440 (2.53 GHz) with 8GB System RAM running 32-bit Windows Server 2008 R2 SP1.

One of the differences between Revolution R products and base R is the ability to leverage multithreading and processor capabilities on all x86 platforms to increase performance. Thus, the more cores available to Revolution R, the higher your performance for many operations. 



R-25 Benchmarks

The simple R-benchmark-25.R test script is a quick-running survey of general R performance. The Community-developed test consists of three sets of small benchmarks, referred to in the script as Matrix Calculation, Matrix Functions, and Program Control.

Click to enlarge Click to enlarge Click to enlarge

 

  Base R 2.13.2 32 Revolution R (1-core) Revolution R (4-core) Speedup (4 core)
Matrix Calculation 24.9 sec 6.5 sec 3.8 sec 5.5x
Matrix Functions 19.8 sec 4.7 sec 2.3 sec 7.7x
Program Control 4.7 sec 4.6 sec 4.6 sec Not Appreciable

Speedup = Slower time / Faster Time - 1   Test descriptions available at http://r.research.att.com/benchmarks


Additional Benchmarks

Revolution Analytics has created its own tests to simulate common real-world computations.  Their descriptions are explained below.

Matrix Multiply Cholesky Factorization
Singular Value Decomposition Principal Components Analysis Linear Discriminant Analysis

 

  Base R 2.13.2 32 Revolution R (1-core) Revolution R (4-core) Speedup (4 core)
Matrix Multiply 174.6 sec 31.0 sec 10.4 sec 15.8x
Cholesky Factorization 25.7 sec 5.0 sec 1.4 sec 17.6x
Singular Value Decomposition 67.6 sec 18.3 sec 7.8 sec 7.6x
Principal Components Analysis 266.2 sec 53.7 sec 20.1 sec 12.2x
Linear Discriminant Analysis 224.4 sec 84.4 sec 61.4 sec 2.7x

Speedup = Slower time / Faster Time - 1

Matrix Multiply

This routine creates a random uniform 10,000 x 5,000 matrix A, and then times the computation of the matrix product transpose(A) * A.

set.seed (1)
m <- 10000
n <-  5000
A <- matrix (runif (m*n),m,n)
system.time (B <- crossprod(A))

The system will respond with a message in this format:

User   system elapsed
37.22    0.40   9.68

The “elapsed” times indicate total wall-clock time to run the timed code.

The table above reflects the elapsed time for this and the other benchmark tests. For the Revolution R benchmarks, the computations were limited to 1 core and 4 cores by calling setMKLthreads(1) and setMKLthreads(4) respectively. Note that Revolution R performs very well even in single-threaded tests: this is a result of the optimized algorithms in the Intel MKL library linked to Revolution R. The slightly greater than linear speedup may be due to the greater total cache available to all CPU cores, or simply better OS CPU scheduling--no attempt was made to pin execution threads to physical cores. Consult Revolution R's documentation to learn how to run benchmarks that use fewer cores than your hardware offers.

Cholesky Factorization

The Cholesky matrix factorization may be used to compute the solution of linear systems of equations with a symmetric positive definite coefficient matrix, to compute correlated sets of pseudo-random numbers, and other tasks. We re-use the matrix B computed in the example above:

system.time (C <- chol(B))

 

Singular Value Decomposition with Applications

The Singular Value Decomposition (SVD) is a numerically-stable and very useful matrix decompisition. The SVD is often used to compute Principal Components and Linear Discriminant Analysis.

# Singular Value Deomposition
m <- 10000
n <- 2000
A <- matrix (runif (m*n),m,n)

system.time (S <- svd (A,nu=0,nv=0))

# Principal Components Analysis
m <- 10000
n <- 2000
A <- matrix (runif (m*n),m,n)

system.time (P <- prcomp(A))

# Linear Discriminant Analysis
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)
system.time (L <- lda(fac ~., data=A, prior=rep(1,g)/g, subset=train))