in reply to Re^2: Parallel::ForkManager is time consuming...takes too long
in thread Parallel::ForkManager is time consuming...takes too long

Still too trivial. Do something that takes some noticeable amount of time. The simplest example would be, e.g., sleep for a few seconds. I often use Parallel::ForkManager for things that individually take a few minutes, it's not much good for things that take a tiny fraction of a second.
  • Comment on Re^3: Parallel::ForkManager is time consuming...takes too long

Replies are listed 'Best First'.
Re^4: Parallel::ForkManager is time consuming...takes too long
by esolkc (Acolyte) on Aug 12, 2011 at 23:26 UTC
    Is a double loop over 1,000,000 and 20,000 not big enough for fork. I need the process to be finished in less than 30 sec., while using all cores. The sleep() example is difficult to compare to the issue I outlined. I could not find in the documentation how the forking is implemented.
      I don't know how long your 1,000,000 or 20,000 long loops take, but if you're forking 20 billion times, I bet it's going to be slower. If you can divide your 20 billion loops into some smaller number and only fork that many times (and do more work in each loop), then maybe you can get some benefit from forking.