Skip to content

Commit ec97bc2

Browse files
authored
Avoid allocation in progcaster (#622)
Previously, we'd first clone the changes to be sent downstream before converting them to a vector. This can cause two allocations, one for cloning the change batch, and one for the `to_vec` call (it takes self by reference). This change adjusts it so that we convert the SmallVec into a vector (`into_vec`). Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
1 parent 291de98 commit ec97bc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timely/src/progress/broadcast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl<T:Timestamp+Send> Progcaster<T> {
104104
self.to_push = Some(Bincode::from((
105105
self.source,
106106
self.counter,
107-
changes.clone().into_inner().to_vec(),
107+
changes.clone().into_inner().into_vec(),
108108
)));
109109
}
110110

0 commit comments

Comments
 (0)