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

Faster B[:,i] for a BandedMatrix using broadcasting #421

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Feb 1, 2024

Currently, broadcasting is faster than setindex! as SIMD gets blocked in the latter (JuliaLang/julia#40962 (comment)), so this change uses the faster variant. This might need revisiting in the future if setindex! becomes significantly faster.

On master

julia> B = brand(6000,6000,4000,4000);

julia> @btime $B[:, 3];
  4.985 μs (4 allocations: 47.00 KiB) # master
  3.980 μs (4 allocations: 47.00 KiB) # PR

julia> @btime $B[:, 5000];
  5.619 μs (4 allocations: 47.00 KiB) # master
  4.462 μs (4 allocations: 47.00 KiB) # PR

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e445b49) 89.55% compared to head (33229d7) 89.55%.
Report is 11 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #421   +/-   ##
=======================================
  Coverage   89.55%   89.55%           
=======================================
  Files          25       25           
  Lines        3542     3544    +2     
=======================================
+ Hits         3172     3174    +2     
  Misses        370      370           

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

@jishnub jishnub merged commit ff75189 into JuliaLinearAlgebra:master Feb 1, 2024
13 checks passed
@jishnub jishnub deleted the getindexbroadcast branch February 1, 2024 16:08
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.

1 participant