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

Memory alloc improvements #341

Merged

Conversation

antiguru
Copy link
Member

A collection of small improvements to bypass the memory allocator when possible.

src/trace/mod.rs Outdated
Comment on lines 169 to 170
target.clone_from(batch.upper());
target.clear();
target.extend(batch.upper().iter().cloned());
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit surprising as an improvement. I think clone_from() is supposed to do this already.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this change as it should be superseded by frankmcsherry/timely-dataflow@7f5b8b7

Copy link
Member

Choose a reason for hiding this comment

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

For posterity: clone_from() does not do the expected thing; the derived implementation calls clone() rather than clone_from().

This commit changes the TraceAgent to keep a buffer for temporary
antichains around, which is used for setting the logical and physical
compaction. The upside is that it avoids temporary allocations, but
on the downside it keeps another antichain around.

This should be fine, unless there is a defective use case where the size
of the antichain grows significantly and the potentially unused memory will
not be reclaimed anymore.

Signed-off-by: Moritz Hoffmann <[email protected]>
@antiguru antiguru marked this pull request as ready for review September 10, 2021 13:08
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.

These look great, thanks!

@frankmcsherry frankmcsherry merged commit 7f1133a into TimelyDataflow:master Sep 10, 2021
@antiguru antiguru deleted the memory_alloc_improvements branch September 10, 2021 14:44
This was referenced Oct 29, 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