Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: To Fork or Not to Fork (bottle necks)

by pimperator (Acolyte)
on Jul 01, 2014 at 16:50 UTC ( [id://1091870] : note . print w/replies, xml ) Need Help??

in reply to Re: To Fork or Not to Fork (bottle necks)
in thread To Fork or Not to Fork. Tis a question for PerlMonks

Thank you for the detailed reply. To clarify, my code sends a command to the system to convert a large file into a larger file using another program. Because there is no I/O, it would be advantageous to use Parallel::ForkManager.

But when I open each file and read them, it's better to do it in a serial fashion.

Replies are listed 'Best First'.
Re^3: To Fork or Not to Fork (how many, not who)
by tye (Sage) on Jul 01, 2014 at 19:47 UTC
    Because there is no I/O

    It is true that your Perl script isn't doing the I/O, but it is very much not true that "there is no I/O".

    Whether Perl is doing the I/O or computing vs. some other program doing it has little bearing on the performance impact of having Perl fork() so you can have more than 1 instance running at once.

    - tye