Vectors vs. Tuples and multiple dispatch

In this case, it’s necessary to use the Ref trick to prevent the compiler from optimizing away the static argument:

julia> @btime f($(Ref(x))[], 0.5)
  13.313 ns (0 allocations: 0 bytes)
3-element SVector{3, Float64} with indices SOneTo(3):
 1.0
 1.1414753094008567
 1.0328495717100694
4 Likes