-
Notifications
You must be signed in to change notification settings - Fork 38
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
Precompile basic algebra operations #283
Precompile basic algebra operations #283
Conversation
Codecov ReportBase: 80.55% // Head: 80.60% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
==========================================
+ Coverage 80.55% 80.60% +0.05%
==========================================
Files 23 24 +1
Lines 3270 3279 +9
==========================================
+ Hits 2634 2643 +9
Misses 636 636
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. |
I'm not sure this is worth it: there's added complexity by adding another dependency and the speedups are not that significant. |
I think there might be lower-hanging gains elsewhere, but we should consider this on a longer term. I'd say that gains that we see here are significant, as the time to load the package increases by less than the decrease in TTFX, so even a single operation is faster overall. On master: $ time julia --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); B + B'
julia --project -e 6.35s user 0.97s system 97% cpu 7.543 total This PR $ time julia --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); B + B'
julia --project -e 5.94s user 1.05s system 97% cpu 7.186 total |
Update: $ julia-1.9 --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); @time B + B'
0.000116 seconds (63 allocations: 3.578 KiB)
$ julia-1.9 --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); @time B - B'
0.000131 seconds (67 allocations: 3.812 KiB)
$ julia-1.9 --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); @time B * B'
0.000821 seconds (238 allocations: 13.359 KiB)
$ julia-1.9 --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); v = rand(10); @time B * v'
0.507999 seconds (1.38 M allocations: 87.291 MiB, 7.02% gc time, 188.76% compilation time) The first few cases seem completely addressed, while the matrix-vector case seems only slightly improved. |
70840de
to
e3eb264
Compare
With #293 merged, the matrix-vector multiplication is precompiled as well. $ julia-1.9 --project -e 'using BandedMatrices; B = BandedMatrix(0=>rand(10)); v = rand(10); @time B * v'
0.000682 seconds (237 allocations: 13.375 KiB) |
This reduces TTFX to some extent (although more seems possible)
On master
This PR (with Julia v1.8.3)
The biggest gain comes in the matrix-vector multiplication. The recompilation in the addition and subtraction needs to be looked into, as it may be possible to improve this performance further.
On Julia v1.9.0-alpha1
So, the recompilation goes away, but the performance is similar.