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

Shared reference-counted operator path #582

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

antiguru
Copy link
Member

@antiguru antiguru commented Sep 6, 2024

Encapsulate the path for an operator as a Rc<[usize]> that can be shared
among all interested parties, instead of passing owned vectors around. This
avoids some memory allocations for rendering dataflow graphs.

Encapsulate the path for an operator as a `Rc<[usize]>` that can be shared
among all interested parties, instead of passing owned vectors around. This
avoids some memory allocations for rendering dataflow graphs.

Signed-off-by: Moritz Hoffmann <[email protected]>
@@ -94,20 +94,19 @@ where
self.edge_stash.push((source, target));
}

/// Creates a new Subgraph from a channel allocator and "descriptive" indices.
/// Creates a new Subgraph from a channel allocator and "descriptive" indices. The Subgraph's
/// index is the last element of `path`.
pub fn new_from(
Copy link
Member

Choose a reason for hiding this comment

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

I think this is better now! At least, I can't really tell why it made sense to provide the index and the path separately, and there is no self involved for which the path would make sense. I'm tempted to remove the line in the comment that you added, because "The Subgraph's index" is no longer a concept that anyone needs to know about. I would be tempted to "say more" in the comments, but the previous comments were so vague that it's hard to require it. In fact, .. I think the comments are just wrong? There is no channel allocator here yet.

What do you think about

/// Creates a `SubgraphBuilder` from a path of indexes from the dataflow root to the subgraph, terminating with the local index of the new subgraph itself.

Copy link
Member

@frankmcsherry frankmcsherry left a comment

Choose a reason for hiding this comment

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

Ok, I totally get all the Vec<T> into Rc<[T]> stuff and think that is great. I was surprised by some other changes, but I do now think they are both correct and strict improvements in clarity, to boot! Sorry for the hold-up, and thank you for the explanations!

Signed-off-by: Moritz Hoffmann <[email protected]>
@antiguru antiguru merged commit ca17c86 into TimelyDataflow:master Sep 6, 2024
1 check passed
@antiguru antiguru deleted the path_rc branch September 6, 2024 20:44
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