Skip to content

improve group performance#50

Merged
aplavin merged 2 commits into
JuliaData:mainfrom
aplavin:patch-1
Jun 30, 2022
Merged

improve group performance#50
aplavin merged 2 commits into
JuliaData:mainfrom
aplavin:patch-1

Conversation

@aplavin
Copy link
Copy Markdown
Collaborator

@aplavin aplavin commented Apr 30, 2022

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

@aplavin
Copy link
Copy Markdown
Collaborator Author

aplavin commented Apr 30, 2022

Failures on 1.0 seem totally unrelated.

Copy link
Copy Markdown
Member

@andyferris andyferris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unfortunately the push! route can be a little bit slow (last I checked there should be micro-optimization opportunates for Julia there). Have you got a benchmark for these improvements @aplavin?

I find that injecting the type T is really useful for inferring cases like Union{Missing, X}.

Comment thread src/group.jl Outdated
@aplavin
Copy link
Copy Markdown
Collaborator Author

aplavin commented Jun 27, 2022

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 #28 would make much more difference, I think.

@andyferris
Copy link
Copy Markdown
Member

Awesome, that’s still a nice improvement.

@aplavin aplavin merged commit db1924f into JuliaData:main Jun 30, 2022
@aplavin aplavin deleted the patch-1 branch June 30, 2022 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants