JuliaData / SplitApplyCombine.jl

Split-apply-combine strategies for Julia
Other
144 stars 15 forks source link

improve group performance #50

Closed aplavin closed 2 years ago

aplavin commented 2 years ago

create 1-vector instead of creating empty vector and pushing to it

aplavin commented 2 years ago

Failures on 1.0 seem totally unrelated.

aplavin commented 2 years ago

There are minor performance improvements for small groups, and no difference for large groups. Eg:

julia> A = 1:100
1:100

# before
julia> @btime groupview(a -> a % 100, $A);
  8.927 μs (216 allocations: 23.52 KiB)

# after
julia> @btime groupview(a -> a % 100, $A);
  7.812 μs (116 allocations: 15.70 KiB)

Something along these lines https://github.com/JuliaData/SplitApplyCombine.jl/pull/28 would make much more difference, I think.

andyferris commented 2 years ago

Awesome, that’s still a nice improvement.