To me (an uninformed observer) it looks more like a problem of SparseArrays, so I would open an issue there.
I just ran the same with a normal array A = rand(2, 3)
and get zero allocations on both 1.9 and 1.10.
Interestingly, the timings also look significantly different for me in the sparse case (also without the allocation, the normal mul!
seems to have gotten slower – I am running both on the same machine):
# 1.9
julia> A = sprand(2, 3, 0.5);
julia> u, v = rand(2), rand(3);
julia> @btime mul!($u, $A, $v);
12.518 ns (0 allocations: 0 bytes)
julia> u, v = view(rand(2, 3), :, 1), view(rand(2, 3), 1, :);
julia> @btime mul!($u, $A, $v);
19.710 ns (0 allocations: 0 bytes)
# 1.10
julia> using BenchmarkTools, LinearAlgebra, SparseArrays
julia> A = sprand(2, 3, 0.5);
julia> u, v = rand(2), rand(3);
julia> @btime mul!($u, $A, $v);
18.192 ns (0 allocations: 0 bytes)
julia> u, v = view(rand(2, 3), :, 1), view(rand(2, 3), 1, :);
julia> @btime mul!($u, $A, $v);
27.388 ns (1 allocation: 48 bytes)
For normal arrays, it looks more consistent (even got a bit faster in 1.10):
# Julia 1.9
julia> A = rand(2, 3);
julia> u, v = rand(2), rand(3);
julia> @btime mul!($u, $A, $v);
34.493 ns (0 allocations: 0 bytes)
julia> u, v = view(rand(2, 3), :, 1), view(rand(2, 3), 1, :);
julia> @btime mul!($u, $A, $v);
43.833 ns (0 allocations: 0 bytes
# Julia 1.10
julia> A = rand(2, 3);
julia> u, v = rand(2), rand(3);
julia> @btime mul!($u, $A, $v);
33.168 ns (0 allocations: 0 bytes)
julia> u, v = view(rand(2, 3), :, 1), view(rand(2, 3), 1, :);
julia> @btime mul!($u, $A, $v);
39.085 ns (0 allocations: 0 bytes)