# Struggling with pmap

**URL:** <https://discourse.julialang.org/t/struggling-with-pmap/28432>\
**Category:** New to Julia\
**Tags:** parallel\
**Created:** [September 5, 2019, 2:55pm UTC](https://discourse.julialang.org/t/struggling-with-pmap/28432 "2019-09-05T14:55:01Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![raminammour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raminammour/32/13572_2.png) [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Post date:** [September 5, 2019, 4:45pm UTC](https://discourse.julialang.org/t/struggling-with-pmap/28432/9 "2019-09-05T16:45:58Z")

</div>

This thread may help too, it echos what was said above:

> [@Weird behavior of pmap](https://discourse.julialang.org/t/weird-behavior-of-pmap/25910):
>
> The following suboptimal behavior of the parallel map has been observed: 53.927 s (82132566 allocations: 2.81 GiB) 2.011 s (8000041 allocations: 167.85 MiB) 18.922 ms (2 allocations: 7.63 MiB) 20.058 ms (3 allocations: 7.63 MiB) The above was obtained with N = 1\_000\_000 a = rand(N) + rand(N)\*1im using BenchmarkTools using Distributed addprocs(2) @btime aa = pmap(x -\> abs(x), $a) rmprocs(workers()) @btime aa = pmap(x -\> abs(x), $a) @btime aa = abs.($a) @btime aa = map(x -\> abs(x), $a…

---

_[View the full topic](https://discourse.julialang.org/t/struggling-with-pmap/28432)._
