This is a present of the end of year for Elixir programmers from me: The new package “Pelemay Fast Parallel map” has been released! It drives multi cores and is 3x faster than Enum! Check it out, soon!
Pelemay Fast Parallel map (or pelemay_fp) - Fast parallel map function for Elixir
- https://hex.pm/packages/pelemay_fp/0.1.0
- https://github.com/zeam-vm/pelemay_fp
- https://hexdocs.pm/pelemay_fp/0.1.0/PelemayFp.html
Pelemay Fast Parallel map: provides fast Parallel map
function, similar to the Enum
module, although computations will be executed in parallel using Process.spawn/4
.
Here is a quick example on how to calculate the square of each element with PelemayFp:
list
|> PelemayFp.map(& &1 * &1)
We conducted performance evaluation of PelemayFp, Pelemay, Flow, Enum and Pmap on iMac Pro (2017):
## PelemayFpBench
benchmark name iterations average time
PelemayFp 200 10177.85 µs/op
Pelemay 100 16762.24 µs/op
PelemayFp and Pelemay 100 18532.70 µs/op
Flow (without sorting) 100 18731.43 µs/op
Enum 50 31283.36 µs/op
Flow (with sorting) 10 105091.00 µs/op
Pmap 1 1213749.00 µs/op
Thanks! A happy new year!