Skip to content

Explicit loop in converting Bidiagonal/Tridiagonal to Matrix #1283

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Apr 10, 2025

This reduces TTFX.

julia> using LinearAlgebra

julia> T = Bidiagonal(ones(4), ones(3), :L);

julia> @time Matrix(T);
  0.073467 seconds (125.49 k allocations: 6.207 MiB, 99.83% compilation time) # nightly
  0.042144 seconds (46.61 k allocations: 2.310 MiB, 99.65% compilation time) # this PR
julia> T = Tridiagonal(ones(3), ones(4), ones(3));

julia> @time Matrix(T);
  0.077513 seconds (138.71 k allocations: 6.792 MiB, 99.85% compilation time) # master
  0.034220 seconds (37.27 k allocations: 1.867 MiB, 99.58% compilation time) # this PR

Performance is identical, as it's entirely dominated by setting the matrix to zero.

@jishnub jishnub added arrays [a, r, r, a, y, s] ttfx The change pertains to first-call latency labels Apr 10, 2025
@jishnub jishnub changed the title Explicit loop in converting Bidiagonal to Matrix Explicit loop in converting Bidiagonal/Tridiagonal to Matrix Apr 10, 2025
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.99%. Comparing base (a8fd121) to head (5576178).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1283      +/-   ##
==========================================
+ Coverage   90.19%   91.99%   +1.80%     
==========================================
  Files          34       34              
  Lines       15797    15503     -294     
==========================================
+ Hits        14248    14262      +14     
+ Misses       1549     1241     -308     

☔ 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 merged commit 2d27d1c into master Apr 11, 2025
4 checks passed
@jishnub jishnub deleted the jishnub/bidiag_matrix branch April 11, 2025 03:31
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] ttfx The change pertains to first-call latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants