How to estimate the runtime of a parfor-loop? Whats wrong with this?

1 次查看(过去 30 天)
I have a MacBook Pro 2017 with 3,5 GHz Intel Core i7. As I know i7 has 4 cores. I've tried the following example script: https://www.mathworks.com/help/distcomp/parfor.html Elapsed time is 11.989581 seconds with parfor, and 20.450299 seconds with simple for. Why? I expect factor 4 (the number of cores), and not factor 2. I have to set something somewhere to use all cores?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by