bench

MATLAB benchmark

Syntax

bench
bench(N)
bench(0)
t = bench(N)

Description

bench measures the execution speed of six different MATLAB® tasks and compares it to the speed of several other computers. The six tasks are:

TestDescriptionPerformance Factors
LUPerform lu of a full matrixFloating-point, regular memory access
FFTPerform fft of a full vectorFloating-point, irregular memory access
ODESolve van der Pol equation with ode45Data structures and MATLAB function files
SparseSolve a symmetric sparse linear systemMixed integer and floating-point
2-DPlot Lissajous curves2-D line drawing graphics
3-DDisplay colormapped peaks with clipping and transforms 3-D animated OpenGL graphics

A final bar chart shows speed, which is inversely proportional to time. The longer bars represent faster machines, and the shorter bars represent the slower ones.

bench(N) runs each of the six tasks N times.

bench(0) just displays the results from other machines.

t = bench(N) returns an N-by-6 array with the execution times.

Tips

Note

A benchmark is intended to compare performance of one particular version of MATLAB on different machines. It does not offer direct comparisons between different versions of MATLAB because tasks and problem sizes change from version to version.

The LU and FFT tasks involve large matrices and long vectors.

The 2-D and 3-D tasks measure graphics performance, including support for hardware-accelerated graphics. The rendererinfo function provides information about the graphics renderer implementation MATLAB is using. For example, this command gets the information for the current axes and stores it in a structure called info.

info = rendererinfo(gca)

Fluctuations of five or ten percent in the measured times of repeated runs on a single machine are normal.

Compatibility Considerations

expand all

Behavior changed in R2020a

Introduced in R2008a