Skip to content

Pipeline the websocket send path#5051

Open
joshua-spacetime wants to merge 1 commit into
masterfrom
joshua/message-pipelining
Open

Pipeline the websocket send path#5051
joshua-spacetime wants to merge 1 commit into
masterfrom
joshua/message-pipelining

Conversation

@joshua-spacetime
Copy link
Copy Markdown
Contributor

@joshua-spacetime joshua-spacetime commented May 16, 2026

Description of Changes

In keeping with the "pipeline everything" ethos, I've replaced recv with recv_many on ClientConnectionReceiver so that a client connection's websocket send path works on a batch of messages at a time, if possible.

API and ABI breaking changes

None

Expected complexity level and risk

1.5

Testing

Refactor

@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch 3 times, most recently from 89fde61 to fda28fc Compare May 17, 2026 19:58
@joshua-spacetime joshua-spacetime changed the base branch from joshua/msync-offset-index to master May 17, 2026 20:02
@joshua-spacetime joshua-spacetime marked this pull request as ready for review May 17, 2026 20:02
@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch from fda28fc to 388f0d8 Compare May 17, 2026 20:03
@joshua-spacetime joshua-spacetime requested a review from kim May 17, 2026 20:03
@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch from 388f0d8 to c5c3d1a Compare May 17, 2026 20:13
@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch from c5c3d1a to 0972b81 Compare May 18, 2026 04:30
Copy link
Copy Markdown
Contributor

@kim kim left a comment

Choose a reason for hiding this comment

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

Nice!

fn drain_pending(&mut self, buf: &mut Vec<OutboundMessage>, max: usize) -> usize {
let n = self.pending.len().min(max);
buf.reserve(n);
for update in self.pending.drain(..n) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I think extend() might be slightly more efficient

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