If f is just assignment a .= b then it doesn't allocate but if composed with + or * it does.
using ComponentArrays
using BenchmarkTools
a = rand(3)
b = rand(3)
c = ComponentArray(a = rand(3))
d = ComponentArray(a = rand(3))
function f(a,b)
a .+= b
end
@btime f($a,$b);
# 15.156 ns (0 allocations: 0 bytes)
@btime f($c,$d);
# 42.662 ns (1 allocation: 112 bytes)
@btime f($a,$c);
# 15.188 ns (0 allocations: 0 bytes)
@btime f($c,$a);
# 42.043 ns (1 allocation: 112 bytes)