-
Notifications
You must be signed in to change notification settings - Fork 194
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 of weighted sum #778
Conversation
The current code is calling the `AbstractArray` matrix multiplication fallback, which is slower than BLAS.
Seems like a reasonable extension in this case. Looks like there isn't a test for the |
AFAICT unit weights are tested here, right? Line 479 in 26947bc
|
The CI error seems to be related to sampling?
|
Yeah these also happen on master: https://github.com/JuliaStats/StatsBase.jl/actions/runs/2044798742 |
Hmm, codecov says your new dispatch for |
Alright, I figured out why that method wasn't being hit. The specific line you posted calls a https://github.com/JuliaStats/StatsBase.jl/blob/nl/wsum/src/weights.jl#L616 The https://github.com/JuliaStats/StatsBase.jl/blob/nl/wsum/src/weights.jl#L588 Adding a |
Indeed. I've added a commit which hopefully simplifies the dispatch logic without breaking anything. |
Good to go? |
The current code is calling the
AbstractArray
matrix multiplication fallback, which is slower than BLAS.Fixes #775.
Tests appear to cover all weights types and
AbstractVector
already.