Skip to content

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.

@codecov
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.

@jishnub jishnub requested a review from dlfivefifty August 19, 2024 08:10
@dlfivefifty dlfivefifty merged commit 222bfd8 into master Aug 19, 2024
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.

3 participants