MATLAB - How much do you BENCH?
24 Mar 2009 Quan Quach 11 comments 1,589 views
On a good day, I can bench 185 lbs. My counterpart, Mr. Sutoyo, sometimes struggles with 135 lbs. Luckily, this post is about the MATLAB benchmark, and not about lifting weights. The MATLAB BENCH command allows you to see how fast your computer is when performing certain MATLAB tasks. In the world of computers, it also acts as a means to living vicariously through your souped up PC (or MAC).
BENCH MATLAB Benchmark
BENCH times six different MATLAB tasks and compares the execution
speed with the speed of several other computers. The six tasks are:
LU LAPACK. Floating point, regular memory access.
FFT Fast Fourier Transform. Floating point, irregular memory access.
ODE Ordinary diff. eqn. Data structures and M-files.
Sparse Solve sparse system. Mixed integer and floating point.
2-D plot(fft(eye)). 2-D line drawing graphics.
3-D MathWorks logo. 3-D animated OpenGL graphics.
Contents
I Can Bench This Much
My computer setup consists of the following:
- Intel Pentium D 940 @ 3.2 GHz
- 2 Gigabyte Ram @ 333 MHz
- Nvidia GeForce 6800 XT
- Windows XP OS
To run the bench command, type the following at the MATLAB command prompt:
>>bench(4)
After some intermediate plots and eye candy from MATLAB, you’ll be greeted by the following two images. These graphs will give you an idea of where your computer ranks among pre-selected computer configurations.


Why do we run the bench command 4 times? Well, your computer needs a couple of iterations to get acclimated to MATLAB’s benchmark test. Consider it a “warming up” exercise. Thus, let’s only look at the 4th row of data.
>> bench(4)
ans =
0.2627 0.5587 0.3311 0.5966 0.7169 1.9982
0.1752 0.2905 0.2472 0.4571 0.6253 0.7173
0.1716 0.2941 0.2499 0.4568 0.6329 0.9594
0.1705 0.2980 0.2481 0.4592 0.6530 0.7203
How Much Does Daniel Bench?
The following specs are for Daniel’s PC.
- intel(R) Core(TM)2 Quad CPU Q6600 @2.40 GHz
- 4 Gigabyte Ram @ 500 MHz
- Nvidia Geforce 8800
- Windows Vista 32-bit
His output obviously outclasses mine.
0.0859 0.1977 0.1503 0.8001 0.3879 0.7092
0.0825 0.1892 0.1528 0.4042 0.3720 0.6801
0.0824 0.2024 0.1526 0.4041 0.3889 0.6973
0.0938 0.2063 0.1528 0.3936 0.3855 0.7016
Beaten by a Laptop?
If someone told me that a Laptop could outperform my desktop, I would have found the thought laughable. Apparently, Rob’s Laptop did the impossible. The final benchmark we will share today belongs to Rob’s miniature beast know as the Lenovo.
- Intel® Core™2 Duo processor T9600
- 2GB of PC2-8500 1066MHz DDR3
- Discrete Open GL Graphics ATI Fire GL M86-GL (512MB)
- Windows XP Pro 32-bit
0.1195 0.1318 0.1095 0.2314 0.2870 0.2213
0.0763 0.1335 0.1064 0.2294 0.2698 0.2286
0.0764 0.1309 0.1065 0.2296 0.2706 0.2354
0.0906 0.1349 0.1090 0.2306 0.2853 0.2343
Wow!
How Much do YOU Bench?
How does your computer perform when using the BENCH command? Give it a try and report your results! Don’t forget to list your computer specs as well!
11 Responses to “MATLAB - How much do you BENCH?”
Leave a Reply
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>


Any idea why matlab is so much faster in windows?
Hi guys, interesting topic!
I bought a faster computer last september to run neural nets on long data streams (without bothering to make mex files). The first thing I did was bench it! Specs are:
Vista 64bit
Intel Core 2 Duo E8400
4Gb PC2-6400 800MHz (i was tempted to upgrade to 8Gb)
ATI Redeon HD 3450 256Mb (The slowest bit on my windows experience score)
I’ve enabled multi-threading in Matlab, my best result on four runs was:
0.0680 0.1596 0.1716 0.2720 0.3171 0.1877
Running it again on single-threading:
0.0941 0.1535 0.1693 0.2731 0.3166 0.1788
The scores highlight that Matlab’s bench test is becoming outdated as most of the tests run on single threads. Maybe Daniel and Rob could squeeze some extra juice by enabling multi-threading in the matlab preferences?
James
Great blog entry name! And the content was good too!
-Ken
Make sure that everyone is using the same version of MATLAB. Bench is only good for comparisons within a version, not between versions.
-MATLABDoug
I wonder what kind of machines the guys at The MathWorks get to use in their everyday work . . . anyone care to share?
James,
As of a couple of releases ago (I believe it was release R2007b, but I could be off by a release or two) the tasks BENCH runs use however many threads MATLAB uses by default.
Not all of the functions used by the tasks are or were multithreaded — for instance, FFT only started taking advantage of multithreading [under certain circumstances] in release R2009a, as stated in the Release Notes:
http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bryg9vd-1.html#br2am8i-1
If you hover your mouse over the labels in the “Computer Type” column in the figure with the table of data, it will indicate some more information about that computer, including how many threads MATLAB was using when that data was collected if applicable.
I’d also like to reiterate MATLABDoug’s comment — the problem sizes BENCH uses sometimes changes from one release to the next as computer performance increases, so if you try to use the output from BENCH in two releases on the same machine, make sure that you’re using the same bench M-file in both releases to make sure you’re comparing apples to apples. [That's the main reason for the disclaimer at the bottom of the figure with the table of data.]
I’ve long wondered how feasible it would be to construct a predictive model of computer speed, as measured by benchmarks. Assuming a single, consistent benchmark program, I bet one could get pretty close using things like processor clock speed, number of cores, operating system, register width etc. Sadly, most collections of benchmark measurements that I’ve been able to find on-line include a wild mix of benchmark programs, processors, etc.
@James,
Good point about the multi-threading. I’m using R2008b, and multi-threading was turned on by default (automatic mode, same number of threads as cores = 2). I ran bench(4) with and without multi-threading, and here’s what I got on run #4 for each:
without multi-threading:
0.1082 0.1359 0.1083 0.2469 0.2615 0.1928
with multi-threading turned on “automatic”:
0.0773 0.1376 0.1098 0.2307 0.2599 0.1923
So there was a clear advantage in the LU test. Slight advantages in the Sparse and 2D tests. Frankly, I was expecting to see improvement in 3D, but it seems that the dedicated video card does what it does independent of the threads in the cpu (my guess).
HTH,
Rob
The multi-threading option only benefits BLAS operations (BLAS supports multi-threading) so that is why there is significant improvement in LU test. MATLAB is still single threaded application, so to really take advantage of multi-core, parallel computing toolbox is necessary.
I ran across this while looking at some of the tutorialsand found it rather interesting. So I thought I would see how mine performed. Results were quite interesting
multi-threaded
0.0481 0.1239 0.1170 0.6314 0.2106 0.6755
single-threaded
0.0972 0.1231 0.1163 0.2120 0.2188 0.6868
a much slower sparse time with multi-threading enabled, somewhat surprising.
Specs:
Vista 64
intel Core i7 920 OCed to 3.2Ghz
6 gbs RAM DDR3 1600 mhz (tri channel)
nvidia 9800GT 1024mb
I had similar results to Caleb above; my times improved on the LU test but worsened significantly in the sparse test AND the ODE test in my case:
Single Thread:
0.1933 0.1617 0.1851 0.3646 0.3063 0.7048
Multithread:
0.1274 0.1625 0.2383 0.8203 0.2974 0.6814
I’m curious what could be causing this. Any thoughts? I am running an old version of matlab (7.5 2007b)
Specs:
Win XP x64
Athalon 64 x2 7750 @2.71 GHz
4 GB Ram
Gefore 9400GT 1 GB onboard ram