Performance costs associated with using local variable bindings

Is there any impact on performance of a function from using local variable bindings for convenience and readability? For example,

function foo(x)
    a,b = x[1:2]
    return a^2 + b^2
end

vs

function bar(x)
    return x[1]^2 + x[2]^2
end

no, but slicing copies so you should use a view.

3 Likes