Skip to content

benches: clone the server_stream payload once per item - #327

Merged
iainmcgin merged 1 commit into
mainfrom
bench-stream-clone
Oct 5, 2026
Merged

iainmcgin merged 1 commit into
mainfrom
bench-stream-clone

Conversation

@iainmcgin

Copy link
Copy Markdown
Collaborator

The server_stream handlers in benches/rpc and benches/rpc-tonic cloned the payload before checking the bound, so the terminating poll of unfold made one more deep copy than the stream had items: 11 for the 10-message benchmark. The payload now travels in the unfold state and is cloned after the check, as benches/rpc-grpc-rust already does.

The README's server_stream (10 messages) row was measured with the extra clone in the connectrpc-rs and tonic columns and without it in tonic-protobuf; the published numbers are unchanged here and are due a re-measure at the next benchmark refresh.

The server_stream handlers in benches/rpc and benches/rpc-tonic cloned
the payload before checking the bound, so the terminating poll of
`unfold` made one more deep copy than the stream had items: 11 for the
10-message benchmark. Carry the payload in the `unfold` state and clone
after the check, as benches/rpc-grpc-rust already does.

Signed-off-by: Iain McGinniss <309153+iainmcgin@users.noreply.github.com>
@iainmcgin
iainmcgin marked this pull request as ready for review October 3, 2026 22:24
@iainmcgin
iainmcgin enabled auto-merge October 3, 2026 22:24
@iainmcgin
iainmcgin added this pull request to the merge queue Oct 5, 2026
Merged via the queue into main with commit cb07896 Oct 5, 2026
14 checks passed
@iainmcgin
iainmcgin deleted the bench-stream-clone branch October 5, 2026 13:44
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