Repository navigation
perf: a noop poll and an unrouted label cost what they did before 11-19 - #9237
Conversation
Quest-Claim: 2c270cebe99ab6fc
A blocked write polled with a noop waiter no longer inserts and removes a stream's waiter entry, and a presence readout omits an all-zero `routes`, which readers already default. 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 28 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. |
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. Both fixes remove the wasted work where it happens: a noop waiter never touches the stream map, and an all-zero routes is never serialized. Neither adds a mechanism.
Reviewed changes
This run reviewed the full diff of the two-commit branch.
Waits::registerearly return: a noop waiter returns beforeentry(id).or_default(). A real waiter always leaves an entry in itsWaiterList, so dropping the remove-if-empty check is safe.wakestill prunes empty entries.kio::Waiter::is_noopmade public: an additive API change, needed bymoq-quic.Presence.routesskipped when zero:skip_serializing_if = "Routes::is_zero"keeps unrouted labels'routesoff the stats wire. Readers already default a missingroutes, and the change is documented indoc/concept/stats.md.- Tests: a Rust round-trip test covers omitted and counted
routes, and the JS schema test covers a missingroutes.
claude-opus-5-5 | 𝕏

Finishes quest/m0/nightly/shared-bench-regressions.md.
Problem
Nightly run 44562804083 flagged three Rust shared bench groups against the 2026-11-18 head. Paired local runs (each commit in its own worktree and target dir, alternating old/new per round, through
quest gate) found:connection_blocked/*: +25 to 30% on every cell, from moq-dev/moq#9152. The bench moved from the waitlesswrite()topoll_write(noop), and feat(quic)!: stream reads and writes wait instead of failing Blocked #9152'sWaits::registerinserts a stream's waiter entry and then removes it again when a noop waiter registers nothing. Production pays it too:moq-uring's readfillpolls with a noop waiter after its first chunk.stats/presence/*: +45 to 60%, from moq-dev/moq#9126, not the quest's suspect moq-dev/moq#9054 (its100lcells are flat). feat(moq-net): a relay counts what its route layer does #9126 added aroutesobject of 20 counters to every label'sPresence, and every tick serializes it for every label, though only routing peers ever count one.relay_auth_refresh/1/1: does not reproduce. Across the whole 11-18 to 11-19 window, 4 of 5 paired rounds are within +1.5%; the fifth inflated every cell together, which is host load.Approach
moq-quicWaits::registerreturns early for a noop waiter, so a poll for the answer alone is one call. With that, a real waiter always leaves a live entry, so the old remove-if-empty check goes. This needskio::Waiter::is_noop, now public.Presence.routesis skipped when all zero. Rust (#[serde(default)]) and JS (zeros()prefault) readers already read a missingroutesas zeros, and moq-json applies RFC 7396 merge patches to the document, so aroutesreturning to zero deletes the key and reads back as zeros.Impact
kio: newWaiter::is_noop. Additive.routesis absent while every route counter is zero. Every reader since feat(moq-net): a relay counts what its route layer does #9126 defaults it, and older readers ignore it.doc/concept/stats.mdsays so.Alternatives
connection_blockedgap, against all of it for the early return, and was more code.connection_blockedcost as "the bench now measures more". It measures a waste production also pays, so fixing it was cheaper than arguing it.Presence. Wider wire change for no measured need;routesis the only group most labels never touch.Validation
Paired medians (Criterion point estimates, 3 rounds unless noted):
mainconnection_blocked/live_1/churn_256connection_blocked/live_1024/churn_256connection_blocked/live_64/churn_16stats/presence/100l_0h(2 rounds)stats/presence/100l_100h(2 rounds)stats/presence/10000l_0h(2 rounds)stats/presencekeeps about +8% over pre-#9126, under the nightly's 10% threshold: the per-session snapshot and sum of the 20 new atomics, which #9126's counters need.presence_routes_stay_off_the_wire_until_counted(Rust) and a missing-routescase injs/statsstats.test.ts. moq-stats' real-relay presence tests (reheld_wire_presence_refreshes_two_relay_cachesand the rest) decode presence frames that now omitroutes, and pass.just cipasses (12565 Rust tests, JS, checks).Caused by
Waits::registerinserts and removes a map entry for a noop waiter, +25 to 30% onconnection_blocked(found by check)routeseach tick, +45 to 60% onstats/presence(found by check)Decisions
kio::Waiter::is_nooppublic rather than restructuringWaits::registeraround a vacant entry; see Alternatives.relay_auth_refresh/1/1as noise rather than accepting it: it has no culprit to accept it.Follow-ups
None.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm A)
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 7889393
Base: origin/main at 847fe82
Risk: high,
Omitting zero-valued `routes` changes the serialized stats wire format and could break consumers that require the field; reverting restores future output but cannot retract frames already sent.Classified: high by Codex, gpt-6.1-sol, low effort, session
01a1faad-ef4f-7900-a4ec-194aa3fc005bReviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1faae-05e5-7751-b8b0-c100b089a1ee, round 1Score: 9/10,
No actionable defects were found: no-op polling preserves live waiters and both readers default omitted route counters to zero, but runtime validation remains pending because builds and tests were not run.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none