• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37777
77%

Build:
DEFAULT BRANCH: master
Ran 13 May 2024 11:36AM UTC
Jobs 1
Files 361
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 May 2024 04:17PM UTC coverage: 86.637% (+0.4%) from 86.279%
#37777

push

local

web-flow
Reduce matmul latency by splitting small matmul (#54421)

This splits the `matmul2x2` and `matmul3x3` into components that depend
on `MulAddMul` and those that don't depend on it. This improves
compilation time, as the `MulAddMul`-independent methods won't need to
be recompiled in the `@stable_muladdmul` branches.

TTFX (each call timed in a separate session):
```julia
julia> using LinearAlgebra

julia> A = rand(2,2); B = Symmetric(rand(2,2)); C = zeros(2,2);

julia> @time mul!(C, A, B);
  1.927468 seconds (5.67 M allocations: 282.523 MiB, 12.09% gc time, 100.00% compilation time) # nightly v"1.12.0-DEV.492"
  1.282717 seconds (4.46 M allocations: 228.816 MiB, 4.58% gc time, 100.00% compilation time) # This PR

julia> A = rand(2,2); B = rand(2,2); C = zeros(2,2);

julia> @time mul!(C, A, B);
  1.653368 seconds (5.75 M allocations: 291.586 MiB, 13.94% gc time, 100.00% compilation time) # nightly
  1.148330 seconds (4.46 M allocations: 230.714 MiB, 4.47% gc time, 100.00% compilation time) # This PR
```

Edit: Not inlining the function seems to incur a runtime perfomance
cost.
```julia
julia> using LinearAlgebra

julia> A = rand(3,3); B = rand(size(A)...); C = zeros(size(A));

julia> @btime mul!($C, $A, $B);
  23.923 ns (0 allocations: 0 bytes) # nightly
  31.732 ns (0 allocations: 0 bytes) # This PR
```
Adding `@inline` annotations resolves this difference, but this
reintroduces the compilation latency. The tradeoff is perhaps ok, as
users may use `StaticArrays` for performance-critical matrix
multiplications.

56 of 63 new or added lines in 1 file covered. (88.89%)

760 existing lines in 19 files now uncovered.

75840 of 87538 relevant lines covered (86.64%)

15719426.95 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
7
90.62
4.52% stdlib/LinearAlgebra/src/matmul.jl

Uncovered Existing Lines

Lines Coverage ∆ File
1
96.01
-0.14% base/sort.jl
1
90.91
-0.41% stdlib/Random/src/generation.jl
1
96.13
2.01% stdlib/LinearAlgebra/src/diagonal.jl
1
95.95
-0.18% stdlib/LinearAlgebra/src/generic.jl
1
86.35
0.26% base/boot.jl
1
66.67
5.68% base/task.jl
1
76.45
1.08% base/loading.jl
2
87.15
-0.23% stdlib/REPL/src/REPLCompletions.jl
2
90.91
-6.06% base/strings/lazy.jl
2
93.8
-0.17% base/bitarray.jl
2
96.43
-1.43% base/compiler/ssair/tarjan.jl
2
90.62
4.52% stdlib/LinearAlgebra/src/matmul.jl
10
60.49
30.84% base/threadingconstructs.jl
19
44.52
1.61% base/util.jl
35
78.09
-4.75% base/stream.jl
55
45.68
-34.32% stdlib/Sockets/src/addrinfo.jl
67
38.1
-53.31% stdlib/Sockets/src/IPAddr.jl
179
44.62
-45.7% stdlib/Sockets/src/Sockets.jl
378
50.05
-36.19% stdlib/Serialization/src/Serialization.jl
Jobs
ID Job ID Ran Files Coverage
1 #37777.1 13 May 2024 11:36AM UTC 361
86.64
Source Files on build #37777
  • Tree
  • List 361
  • Changed 283
  • Source Changed 0
  • Coverage Changed 59
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 50063122 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc