From effa0fd83df469b0c3f252e10b2d79850995170c Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 1 Nov 2026 04:42:54 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m2/perf/adapter-waker-alloc.md Quest-Claim: c550a108b994eb7e From fc8f35248ee4b953a1c088f32e9dfd721fbe38f3 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 1 Nov 2026 05:02:37 -0800 Subject: [PATCH 2/2] quest: delete adapter-waker-alloc, measured no-win moq-tokio and moq-uring hand a stream read or write the task's own waker (`waiter.context()`) and never register the waiter on a kio list, so a parking read allocates no shared waker. Pinned instruction and allocation counts across #7042 show no per-read cost; the quest's Plan deletes it on a measured no-win. Co-Authored-By: Claude Opus 5.5 --- quest/m2/perf/README.md | 1 - quest/m2/perf/adapter-waker-alloc.md | 36 ---------------------------- 2 files changed, 37 deletions(-) delete mode 100644 quest/m2/perf/adapter-waker-alloc.md diff --git a/quest/m2/perf/README.md b/quest/m2/perf/README.md index fcb695d93a5..23a8199d184 100644 --- a/quest/m2/perf/README.md +++ b/quest/m2/perf/README.md @@ -92,7 +92,6 @@ revisions on the same host and worker count, and profiles with - [io_uring buffer pool memory](/quest/m2/perf/uring-pool-memory.md) - measure reserved versus resident pool memory before any shrink policy - [An idle export poll is cheap](/quest/m2/perf/export-idle-poll.md) - an export poll nothing woke skips the track fill and catalog work it repeats today - [Mesh session cost](/quest/m2/perf/mesh-session-cost.md) - moq-net's per-session announce, route sync, and scope work drops, swept over sessions and announces -- [Adapter reads reuse their waker](/quest/m2/perf/adapter-waker-alloc.md) - a measured verdict on the per-read waker allocation moq-tokio and moq-uring reads pay since #7042, fixed if real - [Lite request allocations](/quest/m2/perf/lite-request-allocs.md) - `Path::concat` allocates once and the lite request handler keeps one track-name copy - [Coverage before START](/quest/m2/perf/covered-before-start.md) - the lite-07 publisher's coverage check costs O(1) per wake before SUBSCRIBE_START - [io_uring demux churn](/quest/m2/perf/uring-demux-churn.md) - the demux snapshots stats and builds its fed list once per completion, not per datagram diff --git a/quest/m2/perf/adapter-waker-alloc.md b/quest/m2/perf/adapter-waker-alloc.md deleted file mode 100644 index e8a3ffce37f..00000000000 --- a/quest/m2/perf/adapter-waker-alloc.md +++ /dev/null @@ -1,36 +0,0 @@ -# [S] Adapter reads reuse their waker - -## Goal - -A measured verdict on what a parking read costs in the production adapters -(moq-tokio, moq-uring) since -[moq-dev/moq#7042](https://github.com/moq-dev/moq/pull/7042), and a fix if -the cost is real: a stream read that has to wait stops allocating a fresh -shared waker each time. - -## Plan - -Decided 2026-11-01 (maintainer, `/quest-plan`): measure before fixing, since -no bench has shown the cost yet. - -Since #7042, transport polls take a `kio::Waiter` through `&self`, and every -`kio::wait` future (`rs/kio/src/waiter.rs`) holds a waiter of its own. The -moq-net coding layer (`rs/moq-net/src/coding/reader.rs`, `writer.rs`) wraps -each decode or flush in one, so a read that parks allocates the waiter's -shared `Arc` every time, where a per-stream `kio::Park` used to reuse -one. - -[moq-dev/moq#7262](https://github.com/moq-dev/moq/pull/7262) fixed the -in-memory transport's version (it registered on the session close per read). -The memory-transport benches rarely park, so they cannot see the adapters' -cost. - -Measure first: user-space instruction counts and allocations, pinned to one -core, on moq-uring's `session_lite` bench (`just rs bench-session`) and, for -moq-tokio, which has no crate-level session bench, the relay's -`rs/moq-relay/benches/session.rs` or `just bench BASE`. Measure a revision -before #7042 next to main. A measured no-win deletes this quest. - -If it is real, let a stream keep one waiter (or `kio::Park`) across reads -again, for example in `coding::Reader`, instead of one per `kio::wait` -future.