Skip to content

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Sep 20, 2025

For banded matrices such as Diagonal, we may skip the non-stored elements in computing the norm, as the contribution of these would be zero.

This improves performance.
On master

julia> D1 = Diagonal(rand(1000));

julia> D2 = Diagonal(rand(1000));

julia> @btime norm($D1);
  2.668 ms (0 allocations: 0 bytes)

julia> @btime isapprox($D1, $D2);
  8.007 ms (3 allocations: 7.88 KiB)

vs this PR

julia> @btime norm($D1);
  247.196 ns (0 allocations: 0 bytes)

julia> @btime isapprox($D1, $D2);
  1.696 μs (0 allocations: 0 bytes)

@jishnub jishnub added the arrays [a, r, r, a, y, s] label Sep 20, 2025
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.89%. Comparing base (8d6ca14) to head (99eaf00).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1457      +/-   ##
==========================================
+ Coverage   93.88%   93.89%   +0.01%     
==========================================
  Files          34       34              
  Lines       15933    15931       -2     
==========================================
  Hits        14958    14958              
+ Misses        975      973       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant