Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions timely/src/dataflow/operators/generic/builder_rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ impl<'scope, T: Timestamp> OperatorBuilder<'scope, T> {

let mut logic = constructor(self.mint_capabilities());

// These vectors grew by `push` from empty, reserving capacity four; ports
// are few and the vectors live as long as the operator, so trim the excess.
// The trade is one reallocation per vector at build time for memory
// proportional to ports, rather than capacity, thereafter.
self.frontier.shrink_to_fit();
self.consumed.shrink_to_fit();
self.produced.shrink_to_fit();
self.internal.borrow_mut().shrink_to_fit();

let mut bookkeeping = ProgressBookkeeping {
frontier: self.frontier,
consumed: self.consumed,
Expand Down
Loading