Skip to content

Parallel serde#5774

Merged
blp merged 2 commits intomainfrom
parallel-serde
Mar 11, 2026
Merged

Parallel serde#5774
blp merged 2 commits intomainfrom
parallel-serde

Conversation

@blp
Copy link
Member

@blp blp commented Mar 6, 2026

For my test cases, this raises performance for a 3-minute test run from 81M records to 85M records.

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>
@blp blp requested a review from ryzhyk March 6, 2026 22:56
@blp blp self-assigned this Mar 6, 2026
@blp blp added DBSP core Related to the core DBSP library ft Fault tolerant, distributed, and scale-out implementation performance rust Pull requests that update Rust code multihost Related to multihost or distributed pipelines labels Mar 6, 2026
Copy link

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

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

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();

Choose a reason for hiding this comment

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

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>
@blp blp force-pushed the parallel-serde branch from a147dec to 0d3890a Compare March 6, 2026 23:20
@blp blp added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 6dcefce Mar 11, 2026
1 check passed
@blp blp deleted the parallel-serde branch March 11, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DBSP core Related to the core DBSP library ft Fault tolerant, distributed, and scale-out implementation multihost Related to multihost or distributed pipelines performance rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants