I could not really follow what is said there (“Functions with keyword arguments have near-zero overhead for call sites that pass only positional arguments.”) Is there a call overhead to a simple
f(x, val = y) compared to
A small experiment suggest not:
f(x) = x+1 g(f, x, n) = let y = x; for i in 1:n; y = f(y); end; y end f2(x;y=x) = f(y) g2(f2, x, n) = let y = x; for i in 1:n; y = f2(y; y=y); end; y end
julia> @btime g(f, 1, 10_000) 5.091 ns (0 allocations: 0 bytes) 10001 julia> @btime g2(f2, 1, 10_000) 5.096 ns (0 allocations: 0 bytes) 10001
Or is this maybe to simple to trigger a problem.