Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Jan 12, 2023

We may avoid recursion in _banded_muladd! and directly call _banded_gbmv!instead. This makes type-inference easier, and reduces TTFX.
On master

julia> B = BandedMatrix(0=>ones(1000));

julia> v = zeros(size(B,2));

julia> @time B * v;
  1.007807 seconds (2.95 M allocations: 193.016 MiB, 7.89% gc time, 182.64% compilation time)

This PR

julia> @time B * v;
  0.294613 seconds (647.92 k allocations: 42.859 MiB, 5.88% gc time, 151.79% compilation time)

Tests for BlockBandedMatrices, ApproxFunBase, ApproxFunOrthogonalPolynomials and ApproxFun pass locally for me with this PR. This also resolves the issue with precompiling B * v in #283 (comment)

@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Base: 80.47% // Head: 80.55% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (6a85323) compared to base (7315691).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
+ Coverage   80.47%   80.55%   +0.07%     
==========================================
  Files          22       23       +1     
  Lines        3262     3270       +8     
==========================================
+ Hits         2625     2634       +9     
+ Misses        637      636       -1     
Impacted Files Coverage Δ
src/generic/matmul.jl 72.93% <100.00%> (+1.39%) ⬆️
src/BandedMatrices.jl 100.00% <0.00%> (ø)
src/generic/Band.jl 71.60% <0.00%> (+0.35%) ⬆️
src/lapack.jl 86.36% <0.00%> (+0.48%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jishnub jishnub changed the title Avoid recursion in _banded_muladd! for vector Avoid recursion in _banded_muladd! for vectors Jan 12, 2023
@jishnub jishnub requested a review from dlfivefifty January 17, 2023 05:08
@jishnub
Copy link
Member Author

jishnub commented Jan 24, 2023

Gentle bump @dlfivefifty

@dlfivefifty dlfivefifty merged commit 631883e into JuliaLinearAlgebra:master Jan 25, 2023
@jishnub jishnub deleted the bandedmuladdvector branch January 25, 2023 10:55
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.

2 participants