I was under the impression that ByRow would have better performance than broadcasting. However, trying an example today I found that it seems to be the other way. It may be due to some specific characteristic of my example. In any case, what is the reason for this?
df1 = DataFrame(A = rand(20), B = Float.(collect(1:20)));
# 9.500 μs (144 allocations: 7.91 KiB)
@btime transform(df1, [:A, :B] => ((x, y) -> x .+ y) => :Sum)
df1 = DataFrame(A = rand(20), B = Float.(collect(1:20)));
# 41.400 μs (358 allocations: 24.41 KiB)
transform(df1, [:A, :B] => ByRow((x, y) -> x + y) => :Sum)