The bench_eu_devec benchmark got about 20x slower due to this line:
S[j] .*= exp(t1 + t2*randn())
Changing .*= to *= fixes it. There is a lot of overhead here from making a view and doing a couple function calls (compared to an inlined multiply and store). Here are some ideas:
dotview. Might be better to get an error telling you to remove the dot instead of mysterious bad performance.a[i] .op= x to dotupdate(a, i, op, x), and write a method for i::Int so this case can be fully inlined.This seems to be a consequence of #19799?
@vchuravy, the issue here is that a[i] .= ... creates view(a, i), which is a 0-dimensional subarray for scalars, which predates that PR.
+1 for dotupdate or similar. We've generally tried to make dot operations efficient for scalar operands, to facilitate writing generic code.
Most helpful comment
@vchuravy, the issue here is that
a[i] .= ...createsview(a, i), which is a 0-dimensional subarray for scalars, which predates that PR.+1 for
dotupdateor similar. We've generally tried to make dot operations efficient for scalar operands, to facilitate writing generic code.