# 0.6: how do you broadcast \`call\` over a vector of functions?

**URL:** <https://discourse.julialang.org/t/0-6-how-do-you-broadcast-call-over-a-vector-of-functions/2772>\
**Category:** General Usage\
**Tags:** broadcast\
**Created:** [March 20, 2017, 9:11am UTC](https://discourse.julialang.org/t/0-6-how-do-you-broadcast-call-over-a-vector-of-functions/2772 "2017-03-20T09:11:32Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![andyferris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andyferris/32/235_2.png) [@andyferris](https://discourse.julialang.org/u/andyferris)\
**Post date:** [March 20, 2017, 11:06am UTC](https://discourse.julialang.org/t/0-6-how-do-you-broadcast-call-over-a-vector-of-functions/2772/12 "2017-03-20T11:06:31Z")

</div>

As an illustration:

```julia
julia> f=(x->x,x->x^2)
(#5,#6)

julia> apply(fs::Tuple, x) = _apply(x, (), fs...)
apply (generic function with 1 method)

julia> _apply(x, out::Tuple) = out
_apply (generic function with 1 method)

julia> @inline _apply(x, out::Tuple, f, fs...) = _apply(x, (out..., f(x)), fs...)
_apply (generic function with 2 methods)

julia> @time apply(f, 0.1)
  0.005076 seconds (2.81 k allocations: 133.484 KB)
(0.1,0.010000000000000002)

julia> @time apply(f, 0.1)
  0.000002 seconds (5 allocations: 192 bytes)
(0.1,0.010000000000000002)

julia> @time apply(f, 0.2)
  0.000002 seconds (5 allocations: 192 bytes)
(0.2,0.04000000000000001)

```

That’s a 10^4 speed improvement.

---

_[View the full topic](https://discourse.julialang.org/t/0-6-how-do-you-broadcast-call-over-a-vector-of-functions/2772)._
