Skip to main content
edited body
Source Link
Anton
  • 2.1k
  • 1
  • 7
  • 23

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 funrun this in parallel to cut the execution time?

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 fun this in parallel to cut the execution time?

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?

edited tags
Link
Anton
  • 2.1k
  • 1
  • 7
  • 23
Source Link
Anton
  • 2.1k
  • 1
  • 7
  • 23

Is there any way to parallelize MapThread@AssociationThread?

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 fun this in parallel to cut the execution time?