dot(w, x), sum(x, w) etc. seem to use a slow fallback implementation of dot:
1.7.2> using StatsBase
1.7.2> x = rand(1000); w = weights(rand(length(x)));
1.7.2> x = rand(1000); w = weights(rand(1000));
1.7.2> @btime dot($w, $x)
975.000 ns (0 allocations: 0 bytes)
244.6881117358608
1.7.2> @btime dot($w.values, $x)
85.151 ns (0 allocations: 0 bytes)
244.68811173586084
The same goes for calling sum(x, w) or wsum(x, w).
This is independent of the number of BLAS threads.
This is a pretty dramatic performance difference. Should StatsBase call BLAS.dot or is this something that should be improved in the fallback dot routine in Base?
dot(w, x),sum(x, w)etc. seem to use a slow fallback implementation of dot:The same goes for calling
sum(x, w)orwsum(x, w).This is independent of the number of BLAS threads.
This is a pretty dramatic performance difference. Should StatsBase call
BLAS.dotor is this something that should be improved in the fallbackdotroutine in Base?