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

sqrt, cbrt and log for dense diagonal matrices #1156

Merged
merged 3 commits into from
Dec 23, 2024
Merged

Conversation

jishnub
Copy link
Collaborator

@jishnub jishnub commented Dec 22, 2024

This PR improves performance by only applying the functions to the diagonal elements:

julia> A = diagm(0=>ones(100));

julia> @btime log($A);
  364.163 μs (22 allocations: 401.62 KiB) # master
  13.528 μs (7 allocations: 80.02 KiB) # this PR

Similar improvements for sqrt and cbrt as well.

@jishnub jishnub added arrays [a, r, r, a, y, s] performance Must go faster labels Dec 22, 2024
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.89%. Comparing base (39a7e3c) to head (4f02f26).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1156      +/-   ##
==========================================
+ Coverage   91.85%   91.89%   +0.03%     
==========================================
  Files          34       34              
  Lines       15339    15345       +6     
==========================================
+ Hits        14090    14101      +11     
+ Misses       1249     1244       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jishnub jishnub merged commit 6e5ea12 into master Dec 23, 2024
4 checks passed
@jishnub jishnub deleted the jishnub/diagroot branch December 23, 2024 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants