Merged
Conversation
I don't know why `data` was passed as `&mut` of an iterator. It's easier to just pass an iterator directly. Also, simplify the code inside try_send_all() a bit, and actually enforce the constraint mentioned in the `Panics` section of its doc comment. Signed-off-by: Ben Pfaff <blp@feldera.com>
mythical-fred
approved these changes
Mar 6, 2026
mythical-fred
left a comment
There was a problem hiding this comment.
Nice. Parallelizing serde across workers is exactly the right fix — the background task bottleneck was the obvious culprit. 5% throughput gain for free.
| .take() | ||
| .unwrap() | ||
| .into_serialized() | ||
| .unwrap(); |
There was a problem hiding this comment.
The bare .unwrap() on into_serialized() relies on the invariant that mailboxes for remote receivers always contain Mailbox::Serialized. Worth making that explicit: .expect("remote mailboxes should always be serialized") or a brief // SAFETY: comment.
Until now, when an exchange operator needed to serialize data for transmission to another host, all the serialization for all the transmitted data occurred at the same time, serialized, in the task that did the transmission. This commit changes it so that each worker instead serializes its own data that needs to be sent to another host. This should reduce the latency of serialization by parallelizing it across the sending workers. Similarly, until now, when a host received serialized data from an exchange with another host, it deserialized all of it together in the task that received it. This commit changes it so that each worker deserializes the data that it receives, which should reduce the latency of deserialization by parallelizing it across the receiving workers. Signed-off-by: Ben Pfaff <blp@feldera.com>
ryzhyk
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For my test cases, this raises performance for a 3-minute test run from 81M records to 85M records.