in reply to I thought MCE::Map is faster than usual map. What am I missing?
Given what I consider the semantics of map, you may also think about looking at Parallel::ForkManager::Segmented which gives some convenient sugar for chunking up work among child processes (on top of the awesome Parallel::ForkManager - and I think will reuse them without unduly aborting them prematurely (thus saving the overhead of spawning new processes) - and if doesn't maintain an actual pool, you're at lease amortizing the start up time over multiple items processed rather than one new process per item.
> I tried it with various versions of perl (5.16, 5.24, 5.32 and 5.34) and I get similar results
This is because you're likely testing on the same hardware and OS, which means same forking overhead. It's not rocket surgery.
|
|---|