Skip to content

Generic path in ldiv! for Diagonal #1261

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Apr 4, 2025

The performance improvement in ldiv! is best seen using SparseArrays, as this seems to lack a specialized ldiv! method currently:

julia> D = Diagonal(rand(3000));

julia> S = sprand(size(D,1), 0.01);

julia> @btime ldiv!($D, $S);
  29.620 μs (0 allocations: 0 bytes) # master
  15.388 μs (22 allocations: 154.47 KiB) # This PR

This is because the broadcasting method is taken. Unfortunately, in this example, the in-place broadcasting for a sparse array is allocating, but this should be allocation-free in general.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.97%. Comparing base (925acef) to head (548cc05).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1261      +/-   ##
==========================================
- Coverage   92.03%   91.97%   -0.07%     
==========================================
  Files          34       34              
  Lines       15475    15483       +8     
==========================================
- Hits        14243    14241       -2     
- Misses       1232     1242      +10     

☔ 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.

@jishnub jishnub added the performance Must go faster label Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant