-
-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
JuliaLang/julia
#55764Labels
performanceMust go fasterMust go faster
Description
From this post, I'm finding that rdiv!
on LU objects (added in JuliaLang/julia#31285) is much slower than ldiv!
.
For example:
using LinearAlgebra, BenchmarkTools
function inv2(A)
LU = lu(A)
return ldiv!(LU, Matrix{eltype(LU)}(I, size(A)...))
end
function inv3(A)
LU = lu(A)
return rdiv!(Matrix{eltype(LU)}(I, size(A)...), LU)
end
gives
julia> A = rand(1000,1000); @btime inv($A); @btime inv2($A); @btime inv3($A);
10.791 ms (5 allocations: 8.13 MiB)
10.796 ms (5 allocations: 15.27 MiB)
912.368 ms (5 allocations: 15.27 MiB)
julia> inv(A) ≈ inv2(A) ≈ inv3(A)
true
mikmoore
Metadata
Metadata
Assignees
Labels
performanceMust go fasterMust go faster