Skip to content
Prev 315757 / 398506 Next

foreach takes foreever?

Hi,
On Mon, Jan 21, 2013 at 10:59 AM, Andre Zege <azege at yahoo.com> wrote:
You should keep reading that vignette you are working from :-)
"""
... But for the kinds of quick running operations that we?ve been
doing, there wouldn?t be much point to executing them in parallel.
Running many tiny tasks in parallel will usually take more time to
execute than running them sequentially, and if it already runs fast,
there?s no motivation to make it run faster anyway. But if the
operation that we?re executing in parallel takes a minute or longer,
there starts to be some motivation.
"""

The task you are parallelizing is too trivial. The time to coordinate
the data splitting + forking + etc. is more than just running sqrt.

When the specific task you are running within each iteration is more
involved, the benefit of parallelization will become more clear.

-steve