Skip to content

Conversation

@Frando
Copy link
Member

@Frando Frando commented Jun 6, 2025

Adds remote usage to the benchmark in the compute example.

Results:

Local bench
RPC seq 109_846 rps
RPC par 1_058_271 rps
bidi seq 4_698_821 rps
Remote bench
RPC seq 9_637 rps
RPC par 60_710 rps
bidi seq 223_564 rps
Reference bench
Reference seq 137_783 rps
Reference par 2_926_382 rps

@rklaehn rklaehn merged commit 00082fd into main Jun 12, 2025
16 checks passed
@rklaehn rklaehn deleted the Frando/improve-bench branch June 12, 2025 18:40
Frando added a commit that referenced this pull request Jun 20, 2025
This makes the `Sender` be `Clone` and take `&self` in the methods. For the remote sender, this is achieved by putting the actual send stream and buffer into a `tokio::sync::Mutex`. We also ensure that if sending failed on one sender, subsequent sends on cloned senders will fail as well. And if a `send` future is dropped before completion, further sends will fail as well, as we cannot guarantee integrity of the send stream anymore if a send future was dropped.

## Breaking changes

The methods from `Sender` all take `&self` instead of `&mut self`.

## Notes and open questions

My quick benchmark shows some weird numbers:
```
Local bench
RPC seq 128_996 rps
RPC par 1_093_166 rps
bidi seq 4_281_373 rps
Remote bench
RPC seq 11_393 rps
RPC par 60_073 rps
bidi seq 1_480_826 rps
Reference bench
Reference seq 139_889 rps
Reference par 2_784_308 rps
```

Compared to #24 the `bidi seq` for remote got *much* faster. I can't really explain that? But I ran quite a few times, without much change on either `Frando/improve-bench` or `Frando/clone-sender`.

Fixes #23
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.

3 participants