You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterating over UnitWeights is 30 times slower than iterating over a normal vector on my computer.
using StatsBase, BenchmarkTools
N =1_000
y =ones(N)
w =UnitWeights{Float64}(N)
@btimesum(y[i] for i in1:N)
# 36.911 μs (2490 allocations: 38.91 KiB)@btimesum(w[i] for i in1:N)
# 961.807 μs (9985 allocations: 234.22 KiB)
The text was updated successfully, but these errors were encountered:
matthieugomez
changed the title
Summing UnitWeights is slow
Iterating over UnitWeights is slow
Sep 16, 2020
Iterating over
UnitWeights
is 30 times slower than iterating over a normal vector on my computer.The text was updated successfully, but these errors were encountered: