# Pmap performance regression: pmap(x-\>f(x,y), X) creates copies of y

**URL:** <https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221>\
**Category:** Performance\
**Created:** [August 29, 2018, 12:28am UTC](https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221 "2018-08-29T00:28:41Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [August 30, 2018, 2:57am UTC](https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221/9 "2018-08-30T02:57:24Z")

</div>

> [@tbeason](#):
>
> Have you tried specifically using the cache pool?

I think this is a good suggestion.

For me the `CachingPool` version is comparable to the global version.

```julia
pool = CachingPool(workers())
pmap(pool, x->f_passall(x,bigarr), its)

```

Here’s my timings using Julia v0.6.4:

```julia
Julia-0.6.4> @btime pmap(x->f_passall(x,$bigarr), its);
  52.705 s (2176 allocations: 148.63 KiB)

Julia-0.6.4> @btime pmap(pool, x->f_passall(x,$bigarr), its);
  1.591 ms (1937 allocations: 124.23 KiB)

Julia-0.6.4> @btime pmap(x->f_globals(x), its);
  1.931 ms (1998 allocations: 134.13 KiB)

```

---

_[View the full topic](https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221)._
