-
-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Description
According to the documentation, RFLUFactorization is supposed to be faster than backslash for matrices on the order of a few hundred. I did some quick benchmarking and I'm not finding this to be the case. Am I doing something wrong?
using LinearSolve, BenchmarkTools
n = 200
A = rand(ComplexF64, n, n)
b = rand(ComplexF64, n)
@btime $A\$b ; # 474 μs
prob = LinearProblem(copy(A), copy(b))
@btime solve($prob, LUFactorization()); # 477 μs. As expected, similar to `\`
prob = LinearProblem(copy(A), copy(b))
@btime solve($prob); # 20.4 ms. Not sure what method is used here.
prob = LinearProblem(copy(A), copy(b))
@btime solve($prob, RFLUFactorization()); # 21.8 ms. Forty-some times slower than BLAS LU
prob = LinearProblem(copy(A), copy(b))
method = LinearSolve.FastLUFactorization()
@btime solve($prob, $method); # 14.9 ms . Better but still way slower than BLAS
using LinearAlgebra
BLAS.get_config()
#=
LinearAlgebra.BLAS.LBTConfig
Libraries:
└ [ILP64] libopenblas64_.so
=#
I'm running Julia v1.7.3 and LinearSolve v1.22.1
Also, I found that FastLUFactorization is not exported so I had to invoke it as LinearSolve.FastLUFactorization().
Metadata
Metadata
Assignees
Labels
No labels