Repository navigation
perf(net): skip the clock and grace on an unchanged miss probe - #7140
Conversation
Quest-Claim: a78669a90b5a29cc
Every catalog subscriber probes its misses on each poll. Since #6921 the unchanged fast path read the wall clock and locked the subscriptions for the arrival grace before deciding nothing changed, about 1,070 extra instructions per pending poll. That is the nightly's catalog fanout regression: +22.6% at one track and sixteen readers by instruction count. Read the grace only when a deferred gap could move, and the clock only when one could be due. Every fanout shape now counts at or below 22808bb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 23 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 |
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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 12c80a06b1eb8494750edecd11833cf2bcc34fed.
No actionable bugs found. Moving clock/grace reads behind the existing cheap invalidation checks is a proportionate optimization, preferable to a broader cursor-cache redesign here. Empty deferred sets have no grace deadline to move; nonempty sets still check grace changes, future deadlines re-register their wakeup, and due deadlines are judged. The new test specifically checks that skipping a grace-only change does not give the next gap the old grace.
Verification: static review (including an independent review pass) of the diff, miss/deferred logic and relevant track-state helpers. No tests or benchmarks were run, and the reported performance improvements were not independently reproduced.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge summary:
Landed (Written by Claude Opus 5.5) |
|
Merge summary:
Re-enqueueing this reviewed head under the maintainer's existing merge authorization. (Written by GPT-6.1 Sol) |
Problem
Fixes the catalog fanout regressions from the Rust shared bench targets nightly, which compared
270395a337against22808bbb2f. Completes and deletesquest/m0/nightly/paired-shared.md.Attribution
The regression is real production work, not a changed workload and not a bad comparison.
Fanoutroutine for a fixed number of iterations at each commit and counted user-space instructions withperf stat, pinned to one core type. Setup cost is subtracted. This x86 host matched the ARM runner's wall-clock deltas: hang 1 track/16 readers +22.6%, 1/4 +13.8%, 4/16 +12.0%, MSF 1/16 +18.2%. Currentmain(53c0dcd685) counts the same as270395a337.catalog::Consumer::poll_nextcost about 1,070 more instructions per reader per rise: 3,830 at base, 4,900 at head.Misses::judge, called fromCursor::probeon everypoll_next_group. It reads the wall clock throughmoq_clock::runtime::read(about 12% of all instructions) and locks the subscriptions forTrackState::arrival_grace(4%). Both happen before it checks whether anything changed.6556faf923) moved both reads ahead of that check. The old check,self.at == Some(at) && self.deferred.is_empty(), returned without touching either.Config::default(), but none of its symbols are hot.features.txtin the retainedbench-rust-sharedartifact).Approach
Misses::judgenow checks the cheap terms first: position, budget, ended, and the ledger and drops revisions.The new test
a_grace_change_with_nothing_deferred_times_the_next_gapcovers both halves:Impact
Measurements (instructions per iteration, all 18 shapes)
22808bbb2fShapes are tracks/readers, with 1,001 estimate rises per iteration. These are instruction counts, not wall time, because about 25 agents share this host.
Checks
Current head
4bb5723fa844fae925082459dc5c4c8698761b64:BASH_ENV=/dev/null quest gate just ci origin/mainpassed in the pinned Nix dev shell against base snapshotc3fcab120688cb00e592895c5930f601c34c5cdb; 8995 tests passed, 96 skipped.Trusted installed
quest check --base origin/main --branch quest/m0/nightly/paired-shared, run outside the PR checkout against freshly fetchedmain(7b840ea5e6b2435d96438803227261a239aaf828): 652 documents passed.Codex completed its review of the current head with no findings; no unresolved review threads remain.
cargo test -p moq-net --all-targetsafter mergingmain(e34f66847b): 2647 lib tests passed, plus every integration targetjust ci origin/mainon the merged head: 8972 tests passedMerging
mainneeded one test fix: moq-dev/moq#7168 added anamedargument toMisses::judge, so the new test now passesNone.cargo test -p moq-mux --lib: 1837 passedcargo clippy -p moq-net --all-targets -D warnings: cleancargo fmt --check: cleanquest check: cleanAlternatives
Follow-ups
Cursor::probe,poll_next_group,poll_drift,syncandlive_edge, all running on a track that has nothing new. Readers multiply it, so a cheaper "nothing changed" check across the cursor's poll would lower every fanout shape.(Written by GPT-6.1 Sol)