perf(bench): add quoting bench for measuring DHT-lookup latency#55
Open
grumbach wants to merge 1 commit intoWithAutonomi:mainfrom
Open
perf(bench): add quoting bench for measuring DHT-lookup latency#55grumbach wants to merge 1 commit intoWithAutonomi:mainfrom
grumbach wants to merge 1 commit intoWithAutonomi:mainfrom
Conversation
Standalone example binary that times the client-side quoting phase against a live network — both single-node `ChunkQuoteRequest` and merkle `MerkleCandidateQuoteRequest` paths, with fine-grained per-stage latency (bootstrap, `find_closest_peers`, per-peer quote RPC p50/p95/max, total). No payment, no wallet, no EVM — quoting only. Used this bench to confirm `find_closest_peers` was eating >90% of quoting latency on mainnet (p50 75s of 80s total) and to validate the fix in saorsa-labs/saorsa-core#96 (2.3× speedup on the `find_closest_peers` stage, 10/10 rep success rate vs 4/10 on baseline). CLI: cargo run --release --example bench-quoting -- \ --mode normal|merkle|both \ --reps N [--concurrency N] [--rep-timeout-secs N] \ [--tag T] [--json-out PATH] [--bootstrap ip:port,...] Per-stage output to stdout; optional JSON dump for cross-run comparison. Loads bootstrap peers from `resources/bootstrap_peers.toml` by default.
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
bench-quotingexample: standalone client-side quoting bench against a live network.find_closest_peers+ quote RPC stages with p50/p95/max per rep, for both single-node and merkle paths.What it does
Measures the quoting phase only — no payment, no wallet, no EVM. Picks random target addresses, calls
find_closest_peers, fires concurrentChunkQuoteRequestorMerkleCandidateQuoteRequest, collects responses. Per-stage timing + summary stats. Optional JSON dump for cross-run comparison.cargo run --release --example bench-quoting -- \ --mode normal|merkle|both \ --reps N [--concurrency N] \ [--rep-timeout-secs N] [--tag T] [--json-out PATH] \ [--bootstrap ip:port,...]Bootstrap peers default to
resources/bootstrap_peers.tomlshipped in the repo; override with--bootstrap.Why
When I started digging into slow uploads yesterday, I needed a way to isolate the quoting phase from everything else (encryption, payment, storage RPC). This bench does that, and gives enough granularity (p50/p95 per stage, per-peer timing) to point at the actual slow stage.
The first bench run nailed it: on mainnet,
find_closest_peersp50 = 75s of an 80s total rep. Quote RPCs themselves were 280ms p50. The fix (saorsa-labs/saorsa-core#96) cutfind_closest_peersp50 to 33s and lifted rep success from 40% to 100%.Test plan
cargo build --release --example bench-quotingcleanbootstrap_peers.tomlNot in scope