# Converting a multivariate function to a single variate function

**URL:** <https://discourse.julialang.org/t/converting-a-multivariate-function-to-a-single-variate-function/21661>\
**Category:** New to Julia\
**Tags:** functions\
**Created:** [March 9, 2019, 6:23am UTC](https://discourse.julialang.org/t/converting-a-multivariate-function-to-a-single-variate-function/21661 "2019-03-09T06:23:15Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [August 13, 2024, 12:21pm UTC](https://discourse.julialang.org/t/converting-a-multivariate-function-to-a-single-variate-function/21661/14 "2024-08-13T12:21:29Z")

</div>

> [@Why is the splat operator slow?](https://discourse.julialang.org/t/why-is-the-splat-operator-slow/77928):
>
> I was doing some benchmarks and got these results: julia\> using BenchmarkTools julia\> f1(itr) = collect(itr) f1 (generic function with 1 method) julia\> f2(itr) = [itr...] f2 (generic function with 1 method) julia\> gen = (x for x in 1:1000) Base.Generator{UnitRange{Int64}, typeof(identity)}(identity, 1:1000) julia\> @btime f1($gen); 910.000 ns (1 allocation: 7.94 KiB) julia\> @btime f2($gen); 80.200 μs (1988 allocations: 84.44 KiB) Why is the splat operator slower than the collect functi…

---

_[View the full topic](https://discourse.julialang.org/t/converting-a-multivariate-function-to-a-single-variate-function/21661)._
