Thursday, January 10, 2008

Matlab: Performance with Dual Core Processors

Due to the nature of my job and current education, I often run into the engineering software package MATLAB. It's name is an abbreviation for "Matrix Laboratory" which hints at its ability to handle large amounts of data in array/matrix formats with ease. I won't get into the gritty engineering details: you either already know about it and don't care or you don't know about it, don't need it and still don't care. What is interesting, however, is how to optimize the software to run on a dual-core processor. I played around with this a while back when installing the software on my work laptop and thought the results were notable.

The laptop has an Intel Core Duo T2500 processor, and, at the time, had 1GB of RAM (since upgraded to 2GB to boost performance with Vista). The optimization was performed by following some instructions on the MATLAB website which are linked at the end of this post. The "bench()" command in MATLAB was used to evaluate average performance over 5 trials both before and after the optimizations were performed. The figure below shows the before performance. As you can see, the performance falls just short of a 3GHz Pentium 4 machine.



The next figure shows performance under the same conditions as above, but this time after the dual core processor optimization settings have been made. Performance is still shy of a 3GHz Pentium 4 machine, but it does show improvement.



It's a subtle difference between these two charts, but the differences become more apparent when the averages of each 5 trials are plotted together. Most of the performance is pretty similar except in the two categories of "LU" and "Sparse" which represent regular memory access speed and equation solving speed, respectively.

So was it worth making the changes to optimize MATLAB for a dual core processor? I'd say it was, though I'm not sure if writing about it was worth the effort as it took way longer than making the optimization changes and taking a couple of screen shots! If you're interested in running this optimization on your own computer, the instructions can be found as Solution ID 1-34HE9M on MATLAB's support site.

1 comments:

Graham said...

Hey Nate, I'm definitely going to try this on my dual-core work desktop. Its main purpose in life is a MATLAB number cruncher, so any improvement will be worthwhile. Thanks!