Skip to content

perf: reduce per-file allocation overhead; bump to v0.5.6 - #2330

Merged
oferchen merged 1 commit into
masterfrom
perf/push-to-daemon-streaming
Feb 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
perf/push-to-daemon-streaming

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Eliminate ~30K unnecessary heap allocations per 10K-file transfer:
    • Pass PathBuf by value through walk_path/create_entry (2 fewer clones per file)
    • Add ChecksumVerifier::finalize_into() for stack-based digest output
    • Replace vec![0u8; N] with stack array in write_checksum
    • Pre-allocate file_list/full_paths Vecs with capacity 4096
  • Reduces push-to-daemon peak RSS by 11.5% (16.5 MB → 14.6 MB for 10K files)
  • Bump version to 0.5.6
  • Update README.md: add push-to-daemon benchmarks, complete project layout (23 crates), clarify security claims

Benchmark (push-to-daemon, TCP loopback, Linux aarch64)

Workload upstream 3.4.1 oc-rsync v0.5.5 oc-rsync v0.5.6 v0.5.6 vs upstream
10K × 4KB 484 ms 604 ms 388 ms 1.25x faster
1K × 128KB 237 ms 360 ms 142 ms 1.68x faster
100 × 1MB 180 ms 316 ms 90 ms 1.99x faster
Empty dir 96 ms 215 ms 3 ms 32x faster

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -D warnings
  • cargo nextest run --workspace --all-features — 21,710 tests pass
  • Push-to-daemon benchmarked against upstream rsync 3.4.1 in container
  • Wire format unchanged (interop with upstream daemon verified)

Eliminate ~30K unnecessary heap allocations per 10K-file transfer:

- Pass PathBuf by value through walk_path/create_entry (2 fewer
  clones per file) — moves owned PathBufs instead of clone+discard
- Add ChecksumVerifier::finalize_into() for stack-based digest
  output (avoids Vec allocation in transfer hot path)
- Replace vec![0u8; N] with stack array in write_checksum
  (flist/write.rs) for --checksum mode
- Pre-allocate file_list/full_paths Vecs with capacity 4096
  (mirrors upstream flist.c FLIST_START_LARGE pattern)

Reduces push-to-daemon peak RSS by 11.5% (16.5 MB → 14.6 MB for
10K files). Wall time unchanged (I/O-dominated workload).

Update README.md: add push-to-daemon benchmark table, complete
project layout (13 missing crates), clarify security claims.
@oferchen
oferchen merged commit f3c5f9d into master Feb 17, 2026
56 checks passed
@oferchen
oferchen deleted the perf/push-to-daemon-streaming branch February 17, 2026 12:24
oferchen added a commit that referenced this pull request May 1, 2026
perf: reduce per-file allocation overhead; bump to v0.5.6
oferchen added a commit that referenced this pull request May 5, 2026
perf: reduce per-file allocation overhead; bump to v0.5.6
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
spill/mod.rs shrunk from 1919 LoC to 195 LoC after PR #4462 extracted
SpillableReorderBuffer. The embedded test block is now small enough
that splitting would add no value.
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
spill/mod.rs shrunk from 1919 LoC to 195 LoC after PR #4462 extracted
SpillableReorderBuffer. The embedded test block is now small enough
that splitting would add no value.
oferchen added a commit that referenced this pull request May 18, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request May 18, 2026
spill/mod.rs shrunk from 1919 LoC to 195 LoC after PR #4462 extracted
SpillableReorderBuffer. The embedded test block is now small enough
that splitting would add no value.
oferchen added a commit that referenced this pull request Aug 24, 2026
Test-only extraction from spill.rs leaves the parent at 693 LoC
(691 non-test + 2 for the test mod declaration), still over the
650 LoC cap. SPL-3 (PR #4434) and SPL-4 (PR #4426) remain open on
master; SPL-8 is unblocked once SPL-4 lands (parent drops to ~282
LoC per that PR body).
oferchen added a commit that referenced this pull request Aug 24, 2026
spill/mod.rs shrunk from 1919 LoC to 195 LoC after PR #4462 extracted
SpillableReorderBuffer. The embedded test block is now small enough
that splitting would add no value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant