Speed performance of MEX file using Matlab Coder for parfor operation on arrays

조회 수: 2 (최근 30일)
Dave Lee
Dave Lee 2018년 11월 21일
편집: Dave Lee 2018년 11월 21일
Hi,
I am reaching the limits of optimizing running time (also RAM) of my Matlab script. I did use several techniques for optimizing the code, including parfor, vectorization, use sped-up functions, such as FilterM (https://www.mathworks.com/matlabcentral/fileexchange/32261-filterm), preallocate arrays, reuse temporary variable name. The next step I plan to do is converting to MEX function. My Matlab pseudo-code is pretty much doing as below. Do you think I am going to gain benefit of converting to MEX function? Are there any other recommendations for speeding up for my case?
As a side question, should we keep our array operations to the dimensions of 1D and 2D if possible or 3D and 4D result in similar performance (speed, RAM) and how much benefit between two cases? Let say a 4D array of size 10*10*10*10 vs. a 2D array of 100*100 or 1000*10?
Thanks,
parfor index1 = 1:no_loop1
for index2=1:no_loop2
%call functions such as FilterM
%call array operations such as multiplication, division,
% squeeze, sum, cumsum, repmat, cat on 2D, 3D, and 4D arrays
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by