Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces our GroupBy with rust's ChunkBy #3243

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

brooksprumo
Copy link

Problem

We manually implemented GroupBy because it was experimental and only available in rust-nightly. Rust 1.77.0 stabilized this feature, and it is now available in rust-stable as ChunkBy. We can replace our copy with rust std.

Summary of Changes

Replace our GroupBy with rust's ChunkBy.

@brooksprumo brooksprumo self-assigned this Oct 21, 2024
@brooksprumo brooksprumo marked this pull request as ready for review October 21, 2024 16:10
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

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

lgtm
I had to assume the implemented groupby works as we expect? I assume tests would pass if we used the built in groupby?

@brooksprumo
Copy link
Author

The rust-stable version has basically the same test as our version did: https://doc.rust-lang.org/std/primitive.slice.html#method.chunk_by, as doc tests.

I also ran the test for the pruned banks request handler, and compared the grouped_banks_to_purge, and they were identical.

Lastly, I compared the impl in the rust source code, and it is effectively identical to our copy: https://doc.rust-lang.org/src/core/slice/iter.rs.html#3293-3334

I feel good that the rust version works as expected.

@brooksprumo brooksprumo merged commit 05ac482 into anza-xyz:master Oct 21, 2024
40 checks passed
@brooksprumo brooksprumo deleted the group-by branch October 21, 2024 21:12
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
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