|Just another Perl shrine|
Re^5: MCE: Slow IPC between child and gather process in parentby jeffenstein (Friar)
|on May 03, 2018 at 15:10 UTC||Need Help??|
Ok, I'll bite.
I predict that if instead you read the file sequentially (and advised the operating system that this is what you intend to be doing), the OS will read the data from the file in large gulps and stash it in memory, and it would “lazily” write the output in like manner.
But the OP already said:
I have a reasonably large dataset of html files ( +/- 950K files, average size 23K, total size 21G) which I need to parse ...
So it's not possible to read sequentially.
That said, how much the process can benefit or not from parallelism depends on way too many factors (disk layout, OS, kernel parameters, other workloads on the same infrastructure, the phase of Venus, etc.) It's just not possible to make an absolute statement. As marioroy and Anonymous Monk mentioned above, the OP needs to benchmark it in his particular environment to see how much parallelism is optimal.