Commit 7d7dcbf
committed
feat: vendor russh-sftp with serde_bytes perf fix
Add `crates/bssh-russh-sftp`, a temporary fork of upstream `russh-sftp`
following the same pattern as the existing `crates/bssh-russh`.
The only functional change versus upstream v2.1.1 is a
`#[serde(with = "serde_bytes")]` annotation on `protocol::Write::data`
and `protocol::Data::data`, plus a wire-compatible `serialize_bytes`
implementation in `ser.rs`. Without it, `#[derive(Deserialize)]` for
`Vec<u8>` dispatches to `deserialize_seq` and parses the SFTP payload
one byte at a time — `perf` shows ~42% of server CPU in
`VecVisitor::visit_seq` during 1 GiB uploads. The annotation routes
through the existing bulk `try_get_bytes` path in the crate's own
Deserializer, which is already implemented.
Measured impact on a CPU-bound host (Xeon Silver 4214) with an OpenSSH
client performing a 1 GiB SFTP upload:
- upstream russh-sftp 2.1.1: 74.8 MiB/s
- this fork: 96.4 MiB/s (+29%)
OpenSSH `sftp-server` on the same host measures ~101 MiB/s, so the gap
narrows from ~26% to ~5%.
Upstream russh-sftp has had no commits since its v2.1.1 bump
(2025-04-18) and two download-perf issues (#55 closed without root
cause, #70 open) sit unanswered, so the fix lives here until upstream
activity resumes. `sync-upstream.sh` and `create-patch.sh` mirror the
`bssh-russh` tooling so future syncs are mechanical.
The top-level dependency is switched from
`russh-sftp = "2.1.1"` to
`russh-sftp = { package = "bssh-russh-sftp", version = "2.1.1", path = "crates/bssh-russh-sftp" }`
so every `use russh_sftp::...` import in bssh continues to work
unchanged.1 parent 60e1bec commit 7d7dcbf
53 files changed
Lines changed: 4515 additions & 53 deletions
File tree
- crates/bssh-russh-sftp
- patches
- src
- client
- fs
- protocol
- server
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments