Hi,
I paralellize a piece of code in the following way:
anonyFunc = @(x) func(x, paramStruct);
splB = parcellfun(nThreads, anonyFunc, dataCell);
where "paramStruct" is a very large structure array (70000 elements), and
"dataCell" contains each one of the imput data.
The function "func" takes takes around 50 ms, (measured with tic-toc), but when
calling it with parcellfun it takes much longer, around 500 ms.
Same happens when replacing parcellfun with cellfun.
I suspect that this is due to the large size of paramStruct, because this does not happen
when replacing "func" by a dummy function.
Any ideas of how could improve the situation?
Many thanks in advance,
Daniel Arteaga