I think this is a good suggestion.
For me the CachingPool
version is comparable to the global version.
pool = CachingPool(workers())
pmap(pool, x->f_passall(x,bigarr), its)
Here’s my timings using Julia v0.6.4:
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)