-
Notifications
You must be signed in to change notification settings - Fork 152
Increase Performance of \ (and /) for small square matrix #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase Performance of \ (and /) for small square matrix #584
Conversation
Speed comparison (other machine than on discourse).
This PR (with the same matrices):
|
Could you run the following benchmark (results below are on my machine with StaticArrays 0.10.2): julia> using StaticArrays, BenchmarkTools
julia> @benchmark a \ b setup = begin
a = rand(SMatrix{3, 3})
b = rand(SMatrix{3, 3})
end
BenchmarkTools.Trial:
memory estimate: 0 bytes
allocs estimate: 0
--------------
minimum time: 71.394 ns (0.00% GC)
median time: 71.689 ns (0.00% GC)
mean time: 74.010 ns (0.00% GC)
maximum time: 113.456 ns (0.00% GC)
--------------
samples: 10000
evals/sample: 974 |
Seems like a reasonable approach to me. |
New test with old version:
With PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few minor comments. Nice that the allocations are getting elided now.
Do you think the repeated computation of the determinant of |
Ok, first the performance of det(A):
You might be right that this is a point for further improvements. I will try it. |
The results when adding OneTo:
seems pretty identical. |
Yeah, I agree. That's cool! No further comments from me, @andyferris, good to go? |
I think this is fine, let's merge it. |
Concerning this issue.
My proposal for increased performance of A/B if A is 2x2 or 3x3 and B is 2or3xn.
There is an ongoing discussion about this.