[erlang-questions] lists:pmap ?

Ola Andersson A <>
Tue Aug 22 10:42:01 CEST 2017


Reading the discussion about list:mapfind reminded me of a function I rediscovered recently.
It's rpc:pmap/3 that was originally defined for use in a distributed environment, spreading out the processing over several nodes. It actually works on a single multicore node as well even though it wasn't designed for that purpose.
With the limited tests I have done it seems to significantly outperform lists:map/2 and also scale reasonably well. The almost negligible cost of spawning erlang processes is still amazing.
How about adding a lists:pmap/2 function, designed for multicore, in the lists module?
/OLA.



More information about the erlang-questions mailing list