Closed ChrisRackauckas closed 1 year ago
Fixed on Julia 1.10 (and I'm pretty sure 1.9 also)
julia> @btime $x .= $A2.diag.\$b2;
47.766 ns (0 allocations: 0 bytes)
julia> sol = @btime begin
prob = LinearProblem($A2, $b2)
cache1 = init(prob,alias_A = true,alias_b = true)
solve(cache1).u
end;
117.728 ns (1 allocation: 896 bytes)
julia> sol = @btime begin
cache2 = LinearSolve.set_b($cache1, $b2)
cache2 = LinearSolve.set_A(cache2, $A2)
solve(cache2);
end;
47.767 ns (0 allocations: 0 bytes)
After https://github.com/SciML/LinearSolve.jl/pull/244 we see:
We need to figure out how to get rid of those phantom allocations and why the compiler does not remove them in simple solves like this.