improve group performance#50
Merged
Merged
Conversation
Collaborator
Author
|
Failures on 1.0 seem totally unrelated. |
andyferris
requested changes
Jun 27, 2022
Member
andyferris
left a comment
There was a problem hiding this comment.
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}.
Collaborator
Author
|
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. |
Member
|
Awesome, that’s still a nice improvement. |
andyferris
approved these changes
Jun 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
create 1-vector instead of creating empty vector and pushing to it