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

Improve performance in Fill addition #371

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Improve performance in Fill addition #371

merged 1 commit into from
Aug 19, 2024

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Aug 15, 2024

On master

julia> F = Fill(SMatrix{2,2}(1:4), 2, 2); M = Matrix(F);

julia> @btime $F + $M;
  65.964 ns (2 allocations: 288 bytes)

This PR

julia> @btime $F + $M;
  44.739 ns (1 allocation: 192 bytes)

We avoid the extra allocation of a 1-element vector that is there to only ensure scalar-like broadcasting. The same may be achieved by using a Tuple.

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.90%. Comparing base (4bfbeec) to head (b68c55c).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #371   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files           8        8           
  Lines        1086     1106   +20     
=======================================
+ Hits         1085     1105   +20     
  Misses          1        1           

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

@dlfivefifty dlfivefifty merged commit 222bfd8 into master Aug 19, 2024
18 checks passed
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