|R 1.9.0, the latest version of our reference software, a rich and powerful free 'S language dialect' (R benchmark 2.3 script; text file, 13 Kb). Here, we use the Pentium IV-optimized ATLAS library (provided on CRAN), which gives slightly better results in some tests. We have not tested other optimized libraries, like Goto's one.|
|S-PLUS 6.1, the commercial equivalent of R (S-PLUS benchmark 2 script; text file, 10 Kb)|
|Matlab 6.0 (R12), our previous reference (download Matlab benchmark 2 script and accompanying gcd2.m custom function; text file, 10 Kb). Warning! This is not the latest version. At the time I write this (21 April|
|O-Matrix 5.6, a cheap but very fast package, that can run most Matlab scripts (O-Matrix native mode benchmark 2 & O-Matrix Matlab mode benchmark 2 scripts; text files, 10 Kb each)|
|Octave 2.1.42, a free "clone" of Matlab 4 (Octave benchmark 2 script; text file, 10 Kb). The version used was compiled with an optimized ATLAS library for the Pentium IV.|
|Scilab 2.7, a very complete free software, "not unlike" Matlab (Scilab benchmark 2 script; text file, 10 Kb)|
|Ox 3.30, a very efficient matrix package similar to Gauss and free for academic use (Ox benchmark 2 script; text file, 11 Kb)|
I. Matrix calculation: evaluates the ability of performing some common matrix computations.
|I.A: creation, transposition, deformation of a 1500x1500 matrix. This test evaluates the ability to create and manipulate matrices.|
|I.B: creation of a 800x800 normally distributed random matrix and taking the 1000th power of all its elements. Evaluates the speed at which a random matrix is processed element by element.|
|I.C: sorting of 2,000,000 random values. Tests the speed of a sorting operation.|
|I.D: 700x700 cross-product matrix (b = a' * a). Evaluates matrix operations.|
|I.E: linear regression over a 600x600 matrix (b = a \ b'). Tests the speed of execution for linear models evaluation.|
II. Matrix functions: evaluates speed of some preprogrammed matrix functions.
|II.A: fast Fourier transform over 800,000 values. Fourier transform is a commonly used method in signal processing.|
|II.B: eigenvalues of a 320x320 random matrix. Eigenvalues are used in multivariate analyses (PCA, ...).|
|II.C: determinant of a 650x650 random matrix. Calculation of the determinant of a matrix is a common, but unequally optimized, function in matrix calculation packages.|
|II.D: cholesky decomposition of a 900x900 matrix. Another commonly preprogrammed function.|
|II.E: inverse of a 400x400 random matrix. A computationally intensive function for which various algorithms exist (with very different performances).|
III. Programming: evaluates efficiency to run scripts and custom functions.
|III.A: 750,000 Fibonacci numbers calculation. This evaluates the speed of vector calculation.|
|III.B: creation of a 2250x2250 Hilbert Matrix. Evaluates performances in matrix calculation in scripts.|
|III.C: grand common divisors of 70,000 pairs. Tests potentials in using recursive functions.|
|III.D: creation of a 220x220 Toeplitz matrix. Check the speed of execution for loops.|
|III.E: Escoufier's method on a 37x37 random matrix. Tests various aspects of programming combined in a single test.|
Note that tests III.A-E are not most optimized algorithms for each package, but they do test similar features in all of them. For instance, a matrix algorithm for test III.D is often much more efficient, as is a possibly preprogrammed toeplitz() function. Yet, we keep the loop algorithm in all cases... in order to test the speed of loops execution in scripts!
The tests were run three times on a Pentium IV 1.6 Ghz computer with 1 Gb of memory under Windows XP professional and the mean value is recorded. The next table presents results:
|Test (sec)||R 1.9.0||S-PLUS 6.1||Matlab 6.0||O-Matrix
5.6 Ml mode
|O-Matrix 5.6 native||Octave 2.1.42||Scilab 2.7||Ox 3.30|
|I. Matrix calculation|
|II. Matrix functions|
The higher the result (in seconds), the slower the test executes. Low values mean thus higher performances. Results lower than 0.50 (more than twice faster than the reference) are in green; result larger than 2.00 (more than twice slower than the reference) are in violet. We immediately see the progress made in R since version 1.6.2 (about 30% faster, but as much as four to seven times faster for some operations using the optimized libraries).
S-PLUS is a well-recognized standard in statistics, and it is the commercial counterpart of R. As we see here, it is much more slower than R under Windows (it takes four times more to complete all tests)! S-PLUS is well-know for its versatility, and for the ease of exploring statistical models in its environment. It excels in almost all fields of statistics. However, its limits are reached when working with huge datasets. In this case, SAS (not evaluated here) is considered to be faster, and thus more efficient, especially in loops programming where S-PLUS is desperately slow (test III.E)! However, S-PLUS propose alternatives: the For() function for optimized loops, and the apply() family of functions that "vectorize" loops. With middle-size matrices, as in the current test, it is easily outperformed by almost all the other software evaluated here.
Since R offers similar features than S-PLUS, a larger number of additional libraries (more than 300!), and is totally free, it is clearly an excellent choice for statistical analyses. This benchmark shows also that it is also quite good for "number crunching". Moreover, it runs on almost all platforms (Windows, Macintosh, Unix/Linux) and it has not the "loop problem" of S-PLUS (yet it also provides apply() and the like to accelerate loops). However, it does not propose (yet) the same nice user interface with menus and dialog boxes (GUI) as S-PLUS 6.1 does,... (though many professionals do not care about that because they prefer to use scripts and the command line for a finer control on their calculations). R becomes better and better with the successive releases. It is maintained and enriched by a very active community of developers. These are the reasons why we decided to promote it as a reference in our benchmark tests.
Matlab 6 is a commercial standard in pure matrix calculation. It is significantly poorer in statistical models than S-PLUS or R, but it offers a wide range of high-quality toolboxes for specific applications (although, they increase the cost of this already very expensive software!). Concerning speed, it is about as fast as R 1.9.0. However, we did not tested the latest version, 6.5.1, that seems to provide some substantial increase in speed. As being one of the fastest, the richest, the most commonly used and having one of the best user interface, Matlab 6 deserves its status of leading product in matrix programming.
Matlab has several contenders that propose a similar matrix language for a lower price (O-Matrix, Octave, Scilab). Among them, only one is fighting also on the performance level with Matlab 6.0: O-Matrix. Overall, O-Matrix is the fastest matrix computation package we have tested. It is much less expensive than Matlab, and it provides reasonable compatibility. However, O-Matrix does not propose the same range of specialized toolboxes and it runs only on Windows.
The two other "Matlab clones" (Octave & Scilab) are free open source software. Their performances are somewhat lower than Matlab 6.0 and better compare with Matlab 5.3 (see version 1 of the test). Octave aims to be fully compatible with the base version of Matlab 4.2. One should note that Octave runs under the cygwin emulation of Unix in Windows, and this has probably some negative impact on its pure performances. The Unix/Linux native version should run comparatively faster. Scilab proposes many more functions than Octave, but it is not 100% compatible with the Matlab language, and it is the slowest package of this comparison if we except the "loop problem" of S-PLUS.
Ox is a little apart. It is the only package that does not claim compatibility with one of the two standards previously cited: Matlab or S-PLUS. However, it is partly compatible with Gauss, another high quality commercial matrix calculation software regarded as a standard in econometry (not evaluated here, but you will find detailed tests in Stephan Steinhaus' report). It is one of the four software (with R 1.9.0, Matlab and O-Matrix) to be faster than R 1.6.2, that is, our reference software and version for this benchmark. It is particularly good for the execution of scripts (tests III). As it is a lightweight console application that can easily run scripts in batch mode, Ox is an excellent choice to shell matrix calculation scripts in various kind of applications. O-Matrix is even faster, but it is restricted to Windows systems.
The choice of a data analysis software is a difficult task. "Matrix languages" (like all the software we evaluated here) are very flexible because they are programmable and they are able to work very efficiently with matrices (by definition!) that are widely used in data analysis. However, they differ from each other in term of price, richness (the number of function provided), usability (including the quality of their user interface, their status of established standard or not, the quality of their support, their availability on different platforms like Windows, Macintosh, Unix or Linux), and finally, in term of their pure performances. We evaluated the latter here by using a benchmark suite of 15 tests. Considering results obtained with our benchmark (but beware of its limits: only few features were tested, and solely on a Windows platform!), one can conclude:
|R is one of the fastest open source data analysis
packages. Since it is free and provides many additional|
packages for all kind of statistics, we warmly recommend it.
|S-PLUS is slower and much more expensive, but it still offers a better graphical user interface.|
|Matlab is equally fast, rich and offers a well-designed user interface, but it is equally expensive.|
|O-Matrix is the fastest matrix language we have tested on Windows.|
|Currently, no free "clone" of Matlab is as fast as Matlab 6.0 itself.|
|Octave is language-compatible with Matlab, but not a top performer on Windows.|
|Scilab is a free alternative of Matlab for "richness" more than for performance.|
|Ox is a very efficient matrix language, especially for batch process of scripts.|
Last update: 08/03/2003