Repository navigation
bench(transport): SSH sync vs async I/O on slow links (#1889) - #4251
Merged
Merged
Conversation
Adds crates/rsync_io/benches/ssh_sync_vs_async.rs comparing the current blocking Read+Write SSH transport against a tokio spawn_blocking shim on a userspace-throttled loopback wire. Sweeps 1 MiB and 16 MiB payloads at 200 ns/byte to simulate a slow link without requiring privileged tc qdisc netem. The optional ssh-binary smoke cell skips with a clear log line when ssh is absent on PATH, so CI runners without ssh do not fail.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Adds crates/rsync_io/benches/ssh_sync_vs_async.rs comparing the current blocking Read+Write SSH transport against a tokio spawn_blocking shim on a userspace-throttled loopback wire. Sweeps 1 MiB and 16 MiB payloads at 200 ns/byte to simulate a slow link without requiring privileged tc qdisc netem. The optional ssh-binary smoke cell skips with a clear log line when ssh is absent on PATH, so CI runners without ssh do not fail.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Adds crates/rsync_io/benches/ssh_sync_vs_async.rs comparing the current blocking Read+Write SSH transport against a tokio spawn_blocking shim on a userspace-throttled loopback wire. Sweeps 1 MiB and 16 MiB payloads at 200 ns/byte to simulate a slow link without requiring privileged tc qdisc netem. The optional ssh-binary smoke cell skips with a clear log line when ssh is absent on PATH, so CI runners without ssh do not fail.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Adds crates/rsync_io/benches/ssh_sync_vs_async.rs comparing the current blocking Read+Write SSH transport against a tokio spawn_blocking shim on a userspace-throttled loopback wire. Sweeps 1 MiB and 16 MiB payloads at 200 ns/byte to simulate a slow link without requiring privileged tc qdisc netem. The optional ssh-binary smoke cell skips with a clear log line when ssh is absent on PATH, so CI runners without ssh do not fail.
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.
Summary
crates/rsync_io/benches/ssh_sync_vs_async.rsto compare the current blockingRead + WriteSSH transport (SshReader/SshWriterincrates/rsync_io/src/ssh/connection.rs) against atokio::task::spawn_blockingshim driven from acurrent_threadruntime. This is the realistic short-term comparison flagged by the Allow workspace brand metadata aliases #1411 and Fix clippy warnings across workspace #1412 evaluations: an embedder integrating oc-rsync into a tokio application would wrap the blocking SSH stdio inspawn_blockingrather than rewrite the transport.TcpListenerrather than a realsshdso the bench runs unprivileged and identically across Linux, macOS, and Windows CI. TheRead + Writecost model onTcpStreammatchesSshReader/SshWriteron the child's stdio pipes.ThrottledReadadapter that sleepsns_per_byteperread()call. Avoids the kernel-onlytc qdisc add dev lo root netem delay 5mspath that benches cannot configure.ssh_binary_smokecell exercisesssh -Vwhen present and skips with a log line otherwise, so CI without ssh installed does not fail.Bench cells
sync_transfer/1048576,sync_transfer/16777216- blocking writer thread plus blocking reader on the bench thread, both on the throttled loopback wire.async_spawnblocking_transfer/1048576,async_spawnblocking_transfer/16777216- the samesync_transferbody invoked viatokio::task::spawn_blockingfrom acurrent_threadruntime.ssh_binary_smoke/ssh_-V- skipped whensshis absent fromPATH.Cargo.toml deltas
crates/rsync_io/Cargo.toml: tokio dev-dep now requestsrtandio-utilin addition to the existingrt-multi-thread,macros,net. Registers the newssh_sync_vs_asyncbench withharness = false.Test plan
cargo bench -p rsync_io --bench ssh_sync_vs_async -- --quickon Linuxsshdssh_binary_smokecell prints the skip notice on a runner withoutssh