2
$\begingroup$

Consider this code:

list1 = Union@RandomInteger[{1, 5000}, #] & /@ RandomInteger[{500, 5000}, 100000]; list2 = RandomReal[{-1, 1}, #] & /@ (Length /@ list1); at = MapThread[AssociationThread, {list1, list2}]; // AbsoluteTiming 

{52.6453, Null}

Question: Is there any way to run this in parallel to cut the execution time?

$\endgroup$
1
  • 1
    $\begingroup$ You could write a ParallelMapThread as something like ParallelMap[Apply[function], Thread[lists]] but I have no idea if it will be faster. For large expressions the overhead of transferring the data between kernels can be much greater than actually running the function. $\endgroup$ Commented Sep 25 at 16:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.