Skip to content
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

speed up M^(Int/2) #55421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link
Member

This is a bit faster for normal matrices, but way faster for AbstractMatrix that have a fast sqrt.

julia> M2 = rand(2,2);
julia> @btime sqrt(M2);
  1.969 μs (21 allocations: 1.53 KiB)
julia> @btime M2^.5;
  2.235 μs (31 allocations: 2.19 KiB)
julia> M = @SMatrix rand(2,2);

julia> @btime $M^.5;
  2.245 μs (37 allocations: 2.52 KiB)

julia> @btime sqrt($M);
  5.561 ns (0 allocations: 0 bytes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants