Repository navigation
bench(quic): Criterion sweeps of streams, receive, routing, and wire - #5812
Conversation
Criterion benchmarks for moq-quic, so each QUIC rewrite can compare against the code it replaced. A bench-local harness drives a sans-IO client/server pair through the public Connection/Endpoint API only, with no-op packet protection, an unlimited congestion window, and virtual time, so the suite measures protocol CPU and builds on both sides of a rewrite. Every case sweeps two axes, so a cost that grows with a table shows as a slope. The nightly Rust smoke runs each case once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Elapsed time on a loaded host swung unrelated cases by 50-250% between identical runs. Thread CPU time drops descheduling, and fixed endpoint seeds make packet number skips and key update timing repeat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Quest outcome for
(Written by Opus 5.5) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merging. Summary:
Codex review is clean on b7c6698, and CI passes. (Written by Claude Opus 5.5) |
Closes the
quest/m1/quic/coverage/bench.mdquest: the crate-level benchmarks for moq-quic, so the open rewrites (#5711 scheduler, #5735 receive memory, #5674 peer limits) can runjust bench <base>against a fixed suite.What lands
Four Criterion targets under
rs/moq-quic/benches/. Each case sweeps two axes, so a cost that grows with the table rather than the touched path shows up as a slope.send_prioritysend_write_sizereceive_lossreceive_resetreceive_stopendpoint_routeEndpoint::handledispatch of 1024 short header datagramswire_encodepoll_transmitpacket buildingwire_decodewire_ackThe harness (
benches/common/mod.rs) drives a sans-IOPairthrough the publicEndpoint/ConnectionAPI only, so the suite compiles on both sides of a rewrite. It is bench-local and does not touchsrc/tests.noprotection.rs) and the congestion window is unlimited, so a case measures protocol CPU, not AES or a controller model.Measurementovercpu-time), so a host that deschedules the benchmark does not inflate it.iter_custom.sh/gh/nightly.shadds-p moq-quic --bench streams --bench receive --bench endpoint --bench wireto the existingcargo bench ... -- --testsmoke, so every case runs once nightly.just benchpicks the targets up automatically.Public API and wire impact
None. Dev-only: new
[[bench]]targets, pluscriterionandrustls(std, ring) dev-dependencies. No exported items or visibility changed.Merged-first comparison for #5688 and #5690
Both merged before the suite existed, so the suite was copied onto each side: b302891 vs d0c4931 for #5688 (shard), and d0c4931 vs 38436f2 for #5690 (reliable reset). Each side was built in its own target dir and run pinned to one P-core (
taskset -c 3), with--warm-up-time 1 --measurement-time 2 --sample-size 30.Result: neither merge shows a change outside this host's A/A noise. The A/A columns are identical binaries run back to back. The host was at load average 25 on 24 cores, with other builds running. Small cases repeat within about 5%. Cases with large working sets (1024 streams, 64 x 1 KiB writes, 4096 connections) swing 20-130%, and sometimes jump between two modes. The sharpest outlier, #5690
wire_encode/frames_16/packets_1024at -43%, did not reproduce when run alone: d0c4931 measured 527-536 µs and 38436f2 measured 512-561 µs.Median change per case (parentheses: Criterion saw no significant change)
endpoint_route/connections_16/cids_2endpoint_route/connections_16/cids_5endpoint_route/connections_256/cids_2endpoint_route/connections_256/cids_5endpoint_route/connections_4096/cids_2endpoint_route/connections_4096/cids_5receive_loss/streams_1/packets_2receive_loss/streams_1/packets_16receive_loss/streams_16/packets_2receive_loss/streams_16/packets_16receive_loss/streams_256/packets_2receive_loss/streams_256/packets_16receive_reset/streams_16/bytes_0receive_reset/streams_16/bytes_16384receive_reset/streams_256/bytes_0receive_reset/streams_256/bytes_16384receive_reset/streams_1024/bytes_0receive_reset/streams_1024/bytes_16384receive_stop/streams_16/bytes_1100receive_stop/streams_16/bytes_16384receive_stop/streams_256/bytes_1100receive_stop/streams_256/bytes_16384receive_stop/streams_1024/bytes_1100receive_stop/streams_1024/bytes_16384send_priority/streams_1/priorities_1send_priority/streams_16/priorities_1send_priority/streams_16/priorities_8send_priority/streams_256/priorities_1send_priority/streams_256/priorities_8send_priority/streams_256/priorities_64send_priority/streams_1024/priorities_1send_priority/streams_1024/priorities_8send_priority/streams_1024/priorities_64send_write_size/streams_1/bytes_64send_write_size/streams_1/bytes_1024send_write_size/streams_1/bytes_16384send_write_size/streams_64/bytes_64send_write_size/streams_64/bytes_1024send_write_size/streams_64/bytes_16384wire_encode/frames_1/packets_64wire_encode/frames_1/packets_1024wire_encode/frames_16/packets_64wire_encode/frames_16/packets_1024wire_decode/frames_1/packets_64wire_decode/frames_1/packets_1024wire_decode/frames_16/packets_64wire_decode/frames_16/packets_1024wire_ack/packets_256/ranges_1wire_ack/packets_256/ranges_16wire_ack/packets_256/ranges_128wire_ack/packets_2048/ranges_1wire_ack/packets_2048/ranges_16wire_ack/packets_2048/ranges_128A/A 1 is main with this suite. A/A 2 and 3 are the b302891 binary against itself.
What it takes to get a usable signal on this host:
CARGO_TARGET_DIR, cargo did not rebuild when switching checkouts, and every pass silently ran the first binary. That was the cause of an earlier "-18% to -55% routing win for feat(quic)!: shard the relay's QUIC endpoint per core by default #5688", which was not real.Pitfalls the harness pins
StreamEvent::Stopped, as a real app must.min_mtuis pinned to 1452, so black hole detection cannot shrink packets after forged losses.lost_packetspiled up and later iterations got slower.Checks
just checkpasses. All 53 cases passcargo bench -p moq-quic --bench ... -- --test, andsh/gh/nightly.test.pypasses.Follow-ups
bench/run.shpin itself to one core type on hybrid CPUs. It already builds each side in its own target dir.(Written by Opus 5.5)
🤖 Generated with Claude Code