Skip to content

perf: add binary startup overhead benchmark - #3023

Merged
oferchen merged 1 commit into
masterfrom
perf/startup-overhead
Mar 23, 2026
Merged

oferchen merged 1 commit into
masterfrom
perf/startup-overhead

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add scripts/benchmark_startup.sh that measures startup overhead of oc-rsync vs upstream rsync across four scenarios: --version, --help, empty directory dry-run, and 10-file directory dry-run. Uses hyperfine for statistical analysis when available, falls back to bash time loops with mean/median/p99 reporting. Accepts OC_RSYNC/UPSTREAM_RSYNC env vars for binary paths. Outputs JSON results alongside formatted tables.
  • Add crates/cli/benches/startup_benchmark.rs criterion benchmark that profiles argument parsing cost for 8 common flag combinations: -avz --delete, recursive with exclude, backup script flags, dry-run, --version, --help, combined short options, and server-mode sender args.
  • Add criterion dev-dependency and [[bench]] entry to crates/cli/Cargo.toml.

Test plan

  • Verify cargo bench -p cli -- startup compiles and runs the criterion benchmarks
  • Verify scripts/benchmark_startup.sh --help prints usage
  • Verify scripts/benchmark_startup.sh -j /tmp/startup.json produces valid JSON output
  • Verify the script works with both hyperfine and bash fallback paths

Add scripts/benchmark_startup.sh for measuring oc-rsync vs upstream rsync
startup latency across --version, --help, and dry-run scenarios. Uses
hyperfine when available with automatic bash time loop fallback. Outputs
both human-readable tables and machine-readable JSON.

Add criterion benchmark crates/cli/benches/startup_benchmark.rs for
profiling argument parsing overhead of common flag combinations.
@oferchen
oferchen force-pushed the perf/startup-overhead branch from 995c157 to ea93f08 Compare March 23, 2026 19:26
@oferchen
oferchen merged commit de6a544 into master Mar 23, 2026
10 of 17 checks passed
@oferchen
oferchen deleted the perf/startup-overhead branch March 23, 2026 19:27
oferchen added a commit that referenced this pull request May 1, 2026
Add scripts/benchmark_startup.sh for measuring oc-rsync vs upstream rsync
startup latency across --version, --help, and dry-run scenarios. Uses
hyperfine when available with automatic bash time loop fallback. Outputs
both human-readable tables and machine-readable JSON.

Add criterion benchmark crates/cli/benches/startup_benchmark.rs for
profiling argument parsing overhead of common flag combinations.
oferchen added a commit that referenced this pull request May 5, 2026
Add scripts/benchmark_startup.sh for measuring oc-rsync vs upstream rsync
startup latency across --version, --help, and dry-run scenarios. Uses
hyperfine when available with automatic bash time loop fallback. Outputs
both human-readable tables and machine-readable JSON.

Add criterion benchmark crates/cli/benches/startup_benchmark.rs for
profiling argument parsing overhead of common flag combinations.
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