MATLAB Answers

Is it possible to choose computer hardware which best optimizes the performance of MATLAB?

83 views (last 30 days)
For example:
- I would like to know what the minimum specifications are for RAM
- I would like to know which processor is best
- I would like to know what system is best -- UNIX, Windows

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Nov 2020
Edited: MathWorks Support Team on 5 Nov 2020
Many MATLAB users need to optimize MATLAB's performance in order to complete involved computational tasks in minimal time. It is apparent that the performance of any application depends on the availability of system resources. Running MATLAB along with a number of other processes will degrade performance.
Although we do not recommend specific brands of computer hardware, we have certain system requirements, which MATLAB needs to run properly. For more information on system requirements for MATLAB, see the following URL:
This document will address the issue of which computer hardware will help MATLAB perform the best.
NOTE: In answering this question we can only suggest some correlations, not absolutes. Unless you actually run the BENCH command in MATLAB on a particular configuration it is not possible to predict beforehand any measure of performance for MATLAB. An application can be memory-intensive or may heavily use the Central Processing Unit (CPU) for numerical computations. You can benchmark your system by typing BENCH in the MATLAB command window.
It is also worth noting that the MATLAB Accelerator, a performance enhancement added in MATLAB 6.5 (R13) works most significantly on x86 based processors, such as Intel and AMD. More information on writing MATLAB code for performance can be found in the Related Solution listed at the bottom of the page.
It is strongly suggested before you buy a configuration that you download a trial version of MATLAB and run BENCH on that configuration to help in your evaluation. You should not exclusively use BENCH for the evaluation. However, using it can help you discover the performance of the machine for some common MATLAB applications to a first approximation. The systems listed in BENCH are the ones we have evaluated. There may be new systems available that we have not assessed and therefore are not in the list.
Also note that as of MATLAB 7.4 (R2007a), it is possible to enable MATLAB to use the multithreading capabilities of your processor. This might increase performance when executing lengthy element-wise operations. More information is available in the "MATLAB Multiprocessing" section of the documentation.
The "Multithreaded Computation" example benchmarks the effect of multithreading. The categories focused on in this benchmark are:
- LU: Linear algebra.
- FFT: Computation.
- ODE: Function calls.
- Sparse: Computation
- 2D graphics :
- 3D graphics :
Below are two groups of correlations. The strong list we understand better and can link strongly to changes in performance. The weak list we understand less and they typically have a more nebulous effect on performance.
I. Strong correlations:
--------------------------
1. Clock speed and processor family:
Performance can mathematically be computed as follows:
Performance = Clock Rate / (# of CPU instructions * cycles per CPU instruction)
The variables in the denominator are functions of the instruction set, addressing mode, and hardware implementation of the processor components.
Within a processor family the higher the clock rate the better the performance should be. The rate of change in performance is probably smaller at the higher clock rates because other system parameters such as main memory and bus speeds begin to play a critical role. So just going from a 600MHz Pentium to 1.1GHz Pentium will probably not show the corresponding change in performance.
In general you cannot compare the clock speeds of different microprocessor families. For example, many RISC microprocessors can execute multiple instructions per clock cycle. This means, even though their clock rates may be smaller than those that perform fewer instructions per clock cycle, they can potentially perform more work if kept busy.
2. Other necessary Hardware:
A MATLAB application can only be as fast as the slowest hardware component involved such as a data acquisition card to read data in for real time simulation or a graphic card to display results instantly. To get the maximum performance out of MATLAB graphics use the fastest card that you can afford and one that implements as much of the OpenGL in hardware as possible.
3. Enough main memory (RAM):
Adding more RAM than MATLAB will be using will understandably only have a negligible effect on performance since it is the working set size that determines how much memory you need and this varies tremendously on the application. Also, other applications running alongside MATLAB on the same system vary in usage of memory. We recommend a minimum of 1024 MB of RAM for Windows systems. See the systems requirements page mentioned above. The speed in which RAM can be accessed is also an important factor.
You may also want to review The Technical Support Guide to Memory Management for a better understanding of how MATLAB uses memory:
II. Weak to nonexistent correlations:
--------------------------------------------
1. Number of processors:
Since MATLAB code execution is not multi-threaded, adding processors might not change the performance. However, if you have many applications running on the machine, then having multiple processors can greatly improve the throughput of the system.
2. Bandwidth of the system bus:
This is a difficult area to assess. It becomes critical if you are moving large amounts of data in and out of main memory caused either by memory paging of large data sets or file I/O operations in support of database operations.
3. Amount of cache memory:
Cache memory is fast but expensive and therefore usually limited. The cheaper but slower RAM becomes active whenever the cache memory is exhausted.
This is also difficult to assess without careful benchmarking. Unless special needs are identified, systems generally come with an adequate amount of cache memory for many common applications.
Finally, you may consider posting a message to the comp.soft-sys.matlab forum, located here:
 

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!