Skip to content

Conversation

@frankmcsherry
Copy link
Member

Some improvements around consolidation.

First, the consolidate_container method was made into a trait method on ConsolidateLayout, which it required anyhow. This provides a default implementation, but allows other implementors to provide their own optimized implementation. For example, Vec<(D, T, R)> can simply consolidate in place and then mem::swap, which it does. This should make the chunkers based on ConsolidateLayout appropriate for Vec. I also renamed it consolidate_into, which made more sense once it took a &mut self argument.

Second, the implementation of consolidate_into was streamlined. It maintained an Option of the previous key and diff, but always sets this in the first iteration. We can simply take the first step and then maintain a non-optional previous key and diff. Minor, but should be simplifying.

@frankmcsherry frankmcsherry merged commit 84cfc36 into TimelyDataflow:master Dec 8, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Dec 8, 2024
Copy link
Member

@antiguru antiguru left a comment

Choose a reason for hiding this comment

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

Nice!

@frankmcsherry frankmcsherry deleted the consolidation_consolidation branch September 23, 2025 23:01
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