Julia multithreading is running slower than serial, can someone please explain why…? General Usage Performance multithreading floops

You are trying to parallelize this loop:

for idx in axes(random_vehicle_pairs, 2)

but you have:

size(random_vehicle_pairs) = (2, 5)

and each iteration of the loop is fast. So it is very unlikely that this parallelization will help at all, unless your “real” examples have a much greater number of loop iterations. And, in that case, you should try the parallelization with the real numbers.

2 Likes