-
Notifications
You must be signed in to change notification settings - Fork 38
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
More efficient methods for Eye, Fill, Diagonal, etc. #44
Comments
Cool! A PR would certainly be welcomed. |
Great. A practical question. This could be bunch of small PRs, all to the same file. Should I make a branch for each feature from master, or a branch for feature B from the branch from feature A, or ... ? |
It shouldn't matter either way because I'll "squash and merge", so whatever is easiest for you. |
Ok, I'll give it shot. |
@jlapeyre, any updates on this? |
Yes. So, some of the work mentioned above I have done. Here are the relevant PRs that have been merged to FillArrays. Some of the inefficiencies are better addressed elsewhere. This PR to LinearAlgebra has been merged: JuliaLang/julia#30232. The corresponding PR for FillArrays has been merged. But, the improvement over julia#30232 (at least for what I tested) is very slight. One could argue its not worth the code complexity. These PRs to LinearAlgebra still need some work: JuliaLang/julia#30236, JuliaLang/julia#30235 I also found that keeping track of which method is being called was a headache. So I wrote this: https://github.com/jlapeyre/MethodInSrc.jl. I'd like to apply it to other modules or base/stdlib to see if it turns up muddled tests. There are other possible PRs that I did not yet make, for various reasons. At this point, mainly lack of time. I also made earlier, unrelated PRs that are languishing and need attention. |
I have collected several such methods here: https://github.com/jlapeyre/IdentityMatrix.jl.
All the methods included show significantly reduced benchmark times. (I have not posted the times yet) Despite the name of the module there are methods for types other than
Eye
. For instance an efficient method forkron(::AbstractMatrix, ::Diagonal)
is almost as fast as one specialized forEye
.Most of this stuff could be made into PRs to
FillArrays.jl
andLinearAlgebra
.I don't want to go much further before checking if there are other plans underway.
Also, there is some redundancy of methods with
UniformScaling
, which might be fixed with some refactoring or traits or the like.The text was updated successfully, but these errors were encountered: