# Core i7/i9 and Ryzen 7/9 and Threadripper etc owners: Please test your speed with my script. Looking for the suitable CPU for a Matlab computer

15 views (last 30 days)
William Thielicke on 25 Mar 2021
Commented: Walter Roberson on 28 Apr 2021
Hi, I know that this question has been asked very often. But me too, I am looking for the fastest computer to run some very specific Matlab tasks. I am unsure if hyperthreading, the number of cores or the speed per core is the most important for my specific tasks. So I wrote a quick&dirty script with the most time-consuming operations that I will be running, and I am hoping that some of you run the benchmark and report their results. I am also looking forward to general recommendations.
This script tests the speed of cross-correlation, correlation coefficient, CLAHE and spline interpolation (the m-file is attached too). You will need the image processing toolbox. Please post your results and your CPU type, Thank you very much for your help!!!
William
clear all
close all
clc
disp('Preheating CPU...')
for i=1:100
A=rand(1500,1500);
A=sin(cos(A));
end
clear A
disp('Starting tests...')
%% Cross correlation
num=10000;
A=rand(64,64,num);
B=rand(64,64,num);
tic
for i=1:3
result_conv = fftshift(fftshift(real(ifft2(conj(fft2(A)).*fft2(B))), 1), 2);
end
cross_corr_speed=toc/num/64/64/i *1000*1000*1000;
disp(['Cross-correlation = ' num2str(cross_corr_speed) ' ns/correlation/pixel'])
%% Correlation coefficient
tic
for i=1:num
corr_result=corr2(A(:,:,i),B(:,:,i));
corr_result=corr2(B(:,:,i),A(:,:,i));
end
corr_coeff_speed=toc/num/2/64/64 *1000*1000*1000;
disp(['Correlation coefficient = ' num2str(corr_coeff_speed) ' ns/correlation/pixel'])
clear A B
num=20;
A=rand(2000,2000,num);
%% CLAHE
tic
for i=1:num
end
CLAHE_speed=toc/num/2000/2000 *1000*1000*1000;
disp(['CLAHE = ' num2str(CLAHE_speed) ' ns/pixel'])
clear B
%% Interp2
[X,Y] = meshgrid(-30:30);
V = peaks(X,Y);
[Xq,Yq] = meshgrid(-30:0.01:30);
tic
for i=1:10
Vq = interp2(X,Y,V,Xq,Yq,'spline');
end
interp_speed=toc/numel(Vq)/i *1000*1000*1000;
disp(['Interpolation = ' num2str(interp_speed) ' ns/pixel'])
v=ver('MATLAB');
disp(['-> Using MATLAB version ' v.Version ' ' v.Release ' on ' computer '.'])
%{
My results:
Prozessor Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, 2712 MHz, 2 Kern(e), 4 logische(r) Prozessor(en)
Installierter physischer Speicher (RAM) 8,00 GB
Cross-correlation = 42.7083 ns/correlation/pixel
Correlation coefficient = 27.2742 ns/correlation/pixel
CLAHE = 66.2395 ns/pixel
Interpolation = 12.4732 ns/pixel
-> Using MATLAB version 9.7 (R2019b) on PCWIN64.
%}
Walter Roberson on 28 Apr 2021
Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz, 4 core, 32 GB ram (late 2013)
Cross-correlation = 27.7339 ns/correlation/pixel
Correlation coefficient = 11.5872 ns/correlation/pixel
CLAHE = 41.4351 ns/pixel
Interpolation = 10.0465 ns/pixel
-> Using MATLAB version 9.10 (R2021a) on MACI64.
... so a little slower than Harry Laing's but also 4 generations earlier.

R2019b

### Community Treasure Hunt

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

Start Hunting!

Translated by