Skip to content

chore(bench): add daemon cold-start hyperfine harness (DIS-1) - #4813

Merged
oferchen merged 1 commit into
masterfrom
bench/dis-1-daemon-cold-start-harness
May 23, 2026
Merged

oferchen merged 1 commit into
masterfrom
bench/dis-1-daemon-cold-start-harness

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/benchmark_daemon_cold_start.sh, a repeatable hyperfine harness that reproduces the daemon cold-start gap.
  • Baseline this harness measures progress against: oc-rsync daemon initial sync ~1.35s vs upstream rsync ~0.36s on the same workload (~3.7x slower).
  • Subsequent DIS-2 profiling and DIS-4.a-e audits can use this harness to quantify regressions and improvements; DIS-6 fixes can prove their effect.

Design

  • Two daemons run side-by-side on different ports (default 28800 / 28801) with identical module config and identical source corpus seeded into each module.
  • hyperfine --warmup 0 so the very first invocation (TCP handshake, @RSYNCD: greeting, auth probe, module open, flist exchange, generator/receiver wiring) is part of every measured sample - the cold-start cost is not amortised away.
  • The CLIENT is held constant (upstream rsync binary) so the only variable across the two timings is the daemon implementation under test.
  • Per-command --prepare wipes the client-side destination before every sample so quick-check skip never elides the transfer.
  • A post-run summary parses the hyperfine JSON and prints oc / upstream mean wall time and the ratio, with the DIS-1 reference gap (3.70x) inline for quick comparison.
  • Both daemons are torn down on EXIT/INT/TERM via trap.
  • OC_RSYNC_DAEMON_FALLBACK=0 is set so oc-rsync's native daemon path is exercised (not the delegation-to-system-rsync fallback).
  • Binary discovery prefers /usr/local/bin/oc-rsync-dev (rsync-profile container), then target/release/oc-rsync, then target/dist/oc-rsync, then PATH. Upstream rsync is taken from target/interop/upstream-install/{3.4.2,3.4.1}/bin/rsync or /usr/bin/rsync.
  • BENCH_ROOT is constrained to /tmp or /var/tmp to prevent any rm -rf from touching a bind-mounted workspace.

Scope

  • New file only: scripts/benchmark_daemon_cold_start.sh.
  • No Rust source edits. No daemon behaviour change. Measurement-only.

Test plan

  • bash -n syntax check passes.
  • shellcheck -x clean.
  • --help renders usage with options and environment table.
  • Unknown option exits non-zero with usage.
  • Run inside rsync-profile podman container: podman exec rsync-profile bash /workspace/scripts/benchmark_daemon_cold_start.sh -n 10 and confirm the printed ratio is in the ~3-4x range against the documented baseline.
  • Run on bare Linux with target/interop/upstream-install/3.4.2/bin/rsync present and confirm both daemons start and the summary block prints.

Adds scripts/benchmark_daemon_cold_start.sh, a repeatable harness that
reproduces the daemon cold-start gap (oc-rsync ~1.35s vs upstream ~0.36s,
~3.7x) so DIS-2 profiling and DIS-4.a-e audits can measure progress
against a stable reference.

Two daemons (oc-rsync, upstream) run side-by-side on different ports
with identical module config and corpus. hyperfine drives both with
--warmup 0 and per-command --prepare so every sample is a true cold
invocation. The upstream rsync binary is held constant on the CLIENT
side to isolate the daemon-side cost. The summary block prints
oc / upstream mean wall time and the ratio.

Runs cleanly inside the rsync-profile podman container and on bare
Linux CI. shellcheck -x clean. No Rust source touched.
@github-actions github-actions Bot added the chore label May 23, 2026
@oferchen
oferchen merged commit 543074d into master May 23, 2026
10 checks passed
@oferchen
oferchen deleted the bench/dis-1-daemon-cold-start-harness branch May 28, 2026 03:37
oferchen added a commit that referenced this pull request Aug 24, 2026
Adds scripts/benchmark_daemon_cold_start.sh, a repeatable harness that
reproduces the daemon cold-start gap (oc-rsync ~1.35s vs upstream ~0.36s,
~3.7x) so DIS-2 profiling and DIS-4.a-e audits can measure progress
against a stable reference.

Two daemons (oc-rsync, upstream) run side-by-side on different ports
with identical module config and corpus. hyperfine drives both with
--warmup 0 and per-command --prepare so every sample is a true cold
invocation. The upstream rsync binary is held constant on the CLIENT
side to isolate the daemon-side cost. The summary block prints
oc / upstream mean wall time and the ratio.

Runs cleanly inside the rsync-profile podman container and on bare
Linux CI. shellcheck -x clean. No Rust source touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant