MATLAB bench
function
MATLAB provides a bench
function to “measure the execution time of five different benchmarking tasks on your computer and compares the results to several benchmark computers”, where five benchmarking tasks are respectively:

To use this function, we can use bench
to run each benchmarking task for one time, or use bench(N)
for N
times.
Right now, I have a desktop with MATLAB R2023b and a laptop with version R2025a at hand, so I would use these two computers to run the bench
function respectively and see what the results are.
Desktop
MATLAB version
MATLAB version
function:
1
2
| ans =
'23.2.0.2515942 (R2023b) Update 7'
|
GPU
MATLAB rendererinfo
function:
1
2
3
4
5
6
7
| info =
struct with fields:
GraphicsRenderer: 'OpenGL Hardware'
Vendor: 'NVIDIA Corporation'
Version: '4.6.0 NVIDIA 560.94'
RendererDevice: 'NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2'
Details: [1×1 struct]
|
1
2
3
4
5
6
7
8
9
10
| ans =
struct with fields:
RendererDriverVersion: '32.0.15.6094'
RendererDriverReleaseDate: '2024-08-14'
HardwareSupportLevel: 'Full'
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
SupportsGraphicsSmoothing: 1
MaxTextureSize: 32768
MaxFrameBufferSize: 32768
|
The Graphics task measures graphics performance, including support for hardware-accelerated graphics. The rendererinfo
function provides information about the graphics renderer implementation that MATLAB uses. For example, this command gets the information for the current axes and stores it in a structure named info
.
1
| info = rendererinfo(gca)
|
MATLAB gpuDevice
function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| ans =
CUDADevice with properties:
Name: 'NVIDIA GeForce RTX 3060 Ti'
Index: 1
ComputeCapability: '8.6'
SupportsDouble: 1
GraphicsDriverVersion: '560.94'
DriverModel: 'WDDM'
ToolkitVersion: 11.8000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152 (49.15 KB)
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 8589410304 (8.59 GB)
AvailableMemory: 7463235584 (7.46 GB)
CachePolicy: 'balanced'
MultiprocessorCount: 38
ClockRateKHz: 1845000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceAvailable: 1
DeviceSelected: 1
|
CPU
CPU
- 12th Gen Intel(R) Core(TM) i7-12700K 3.60 GHz
MATLAB computer
function:
Memory
MATLAB memory
function:
1
2
3
4
5
6
| Maximum possible array: 12929 MB (1.36e+10 bytes) *
Memory available for all arrays: 12929 MB (1.36e+10 bytes) *
Memory used by MATLAB: 7680 MB (8.05e+09 bytes)
Physical Memory (RAM): 32509 MB (3.41e+10 bytes)
* Limited by System Memory (physical + swap file) available.
|
bench
1
2
3
| clc, clear, close all
t = bench
|
1
2
| t =
0.2974 0.2194 0.1027 0.4119 0.2424 0.1106
|


bench(20)
1
2
3
4
| clc, clear, close all
t = bench(20)
mean(t)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| Warning: BENCH will only display the 10 best times on the comparison graph and in the table of results in the figure window, to
prevent the graph and table from being overcrowded. However, the output argument of BENCH will contain data from all 20 trials.
> In bench (line 134)
In script1 (line 3)
t =
0.3204 0.2392 0.0954 0.4079 0.2849 0.1098
0.3237 0.2180 0.0969 0.4390 0.2034 0.2430
0.3445 0.2219 0.1001 0.4414 0.3419 0.1100
0.3437 0.2130 0.0978 0.4433 0.2059 0.2222
0.3343 0.2159 0.0977 0.4354 0.2877 0.1104
0.3614 0.2195 0.1022 0.4619 0.2988 0.1085
0.3760 0.2196 0.1017 0.4338 0.2037 0.2578
0.3393 0.2244 0.1057 0.4546 0.3244 0.1123
0.3341 0.2139 0.1050 0.4267 0.2179 0.2382
0.3416 0.2213 0.1046 0.4396 0.3404 0.1123
0.3643 0.2165 0.1034 0.4319 0.2107 0.2671
0.3888 0.2337 0.1073 0.4861 0.2118 0.2592
0.3684 0.2290 0.1050 0.4550 0.2139 0.3271
0.3254 0.2492 0.1028 0.4947 0.2241 0.2492
0.3262 0.2286 0.1026 0.4574 0.2045 0.3275
0.3135 0.2314 0.1025 0.4432 0.2188 0.3417
0.3351 0.2320 0.1037 0.4398 0.2126 0.2354
0.3587 0.2272 0.0996 0.4392 0.2188 0.2518
0.3443 0.2242 0.1028 0.4340 0.2131 0.2530
0.3523 0.2332 0.1011 0.4560 0.2079 0.2565
ans =
0.3448 0.2256 0.1019 0.4460 0.2423 0.2197
|


Laptop
MATLAB version
MATLAB version
function:
1
2
| ans =
'25.1.0.2943329 (R2025a)'
|
GPU
MATLAB rendererinfo
function:
1
2
| info = rendererinfo
info.Details
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| info =
struct with fields:
GraphicsRenderer: 'WebGL'
Vendor: 'Google Inc. (NVIDIA)'
Version: 'WebGL 2.0 (OpenGL ES 3.0 Chromium)'
RendererDevice: 'ANGLE (NVIDIA, NVIDIA GeForce RTX 5060 Laptop GPU (0x00002D59) Direct3D11 vs_5_0 ps_5_0, D3D11)'
Details: [1×1 struct]
ans =
struct with fields:
HardwareSupportLevel: 'Full'
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
SupportsGraphicsSmoothing: 1
MaxTextureSize: 16384
MaxFrameBufferSize: 16384
|
MATLAB gpuDevice
function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| ans =
CUDADevice with properties:
Name: 'NVIDIA GeForce RTX 5060 Laptop GPU'
Index: 1 (of 1)
ComputeCapability: '12.0'
DriverModel: 'WDDM'
TotalMemory: 8546484224 (8.55 GB)
AvailableMemory: 7283408896 (7.28 GB)
DeviceAvailable: true
DeviceSelected: true
Show all properties.
Identity
Name: 'NVIDIA GeForce RTX 5060 Laptop GPU'
UUID: 'GPU-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
Index: 1 (of 1)
State
DeviceSelected: true
DeviceAvailable: true
DeviceSupported: true
LastAccessed: 2025-08-05 15:16:28
Memory
TotalMemory: 8546484224 (8.55 GB)
AvailableMemory: 7283408896 (7.28 GB)
CachePolicy: 'balanced'
Driver
GraphicsDriverVersion: '577.00'
DriverModel: 'WDDM'
ComputeMode: 'Default'
KernelExecutionTimeout: true
Capabilities
ComputeCapability: '12.0'
MultiprocessorCount: 26
ClockRateKHz: 1560000
SingleDoubleRatio: 16
Kernel Programming
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152 (49.15 KB)
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
ToolkitVersion: 12.2000
|
CPU
CPU
- Intel(R) Core(TM) Ultra 9 275HX (2.70 GHz)
MATLAB computer
function:
Memory
MATLAB memory
function:
1
2
3
4
5
6
| Maximum possible array: 13132 MB (1.38e+10 bytes) *
Memory available for all arrays: 13132 MB (1.38e+10 bytes) *
Memory used by MATLAB: 5917 MB ( 6.2e+09 bytes)
Physical Memory (RAM): 32189 MB (3.38e+10 bytes)
* Limited by System Memory (physical + swap file) available.
|
bench
1
2
3
| clc, clear, close all
t = bench
|
1
2
3
| t =
0.2852 0.1199 0.0743 0.3936 0.1491
|


bench(20)
1
2
3
4
5
| clc, clear, close all
t = bench(20)
mean(t)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| Warning: BENCH will only display the 10 best times on the comparison graph and in the table of
results in the figure window, to prevent the graph and table from being overcrowded. However, the
output argument of BENCH will contain data from all 20 trials.
> In bench (line 124)
In script (line 3)
t =
0.3833 0.1178 0.0722 0.2581 0.1202
0.3810 0.1220 0.0708 0.2561 0.1419
0.3886 0.1209 0.0705 0.2483 0.1530
0.3698 0.1215 0.0710 0.2555 0.1516
0.3590 0.1168 0.0717 0.2500 0.1580
0.3768 0.1167 0.0723 0.2566 0.1462
0.3730 0.1236 0.0706 0.2566 0.1422
0.3942 0.1213 0.0712 0.2567 0.1500
0.3550 0.1204 0.0709 0.2574 0.1474
0.3807 0.1182 0.0722 0.2565 0.1416
0.3821 0.1360 0.0706 0.2550 0.1472
0.3874 0.1145 0.0726 0.2628 0.1552
0.3795 0.1144 0.0713 0.2479 0.1488
0.3725 0.1229 0.0707 0.2533 0.1484
0.3724 0.1135 0.0720 0.2542 0.1677
0.4001 0.1209 0.0742 0.2646 0.1452
0.3670 0.1222 0.0711 0.2581 0.1566
0.3928 0.1181 0.0704 0.2589 0.1551
0.3784 0.1231 0.0710 0.2522 0.1535
0.3958 0.1208 0.0715 0.2524 0.1416
ans =
0.3795 0.1203 0.0714 0.2556 0.1486
|


Conclusion
From MATLAB R2025a, the bench
function uses the single graphics task to replace 2D and 3D graphic tasks:
The existing 2-D and 3-D tasks have been replaced by a single Graphics benchmarking task. The new Graphics task is a better benchmark for the updated graphics system, which uses more modern architecture, and represents a wider range of graphics workflows.
and we can find this difference in above tests.
Anyway, finally we can conclude that:
|
LU |
FFT |
ODE |
Sparse |
2D |
3D |
Graphics |
Desktop bench |
0.2974 |
0.2194 |
0.1027 |
0.4119 |
0.2424 |
0.1106 |
— |
Laptop bench |
0.2852 |
0.1199 |
0.0743 |
0.3936 |
— |
— |
0.1491 |
Desktop bench(20) (average) |
0.3448 |
0.2256 |
0.1019 |
0.4460 |
0.2423 |
0.2197 |
— |
Laptop bench(20) (average) |
0.3795 |
0.1203 |
0.0714 |
0.2556 |
— |
— |
0.1486 |
It seems that the performance of my laptop exceeds desktop — despite the fact that the laptop uses more latest MATLAB version, and hence comparing their results directly is not that persuasive to some extent — and it is possible, because I bought my desktop in 2021, but bought my laptop this year, 2025. That being said, the difference of running time of each benchmarking task is relatively small, so I think more complicated and more time-consuming tasks can better compare two computers.
References