Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ nix develop --command env SESSION_ALLOCS=1 cargo bench --locked -p moq-net --fea

Throughput counts delivered datagrams. Every one must arrive with its sequence
and payload; the memory transport loses none at these cadences, so a drop fails
instead of looking cheaper. `SESSION_ALLOCS=1` prints allocations, allocated
bytes and, where Linux perf counters are readable, user instructions per
delivered datagram or viewer-group. All three exclude the cache tick. Bytes sum
instead of looking cheaper. `SESSION_ALLOCS=1` prints the group consumer size,
allocations, allocated bytes and, where Linux perf counters are readable, user instructions per
delivered datagram or viewer-group. The counts exclude the cache tick. Bytes sum
requested allocation and reallocation sizes, including growth in place; they
measure neither live memory nor bytes copied. A multiplexed instruction counter
fails the run instead of reporting an undercount. Every task runs on the bench's
Expand Down
1 change: 0 additions & 1 deletion quest/m1/release-perf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ subscribers.
## Required

- [Relay CPU per frame since #5926](/quest/m1/release-perf/relay-cpu-bisect.md) - the 18-56% rise in relay instructions per delivered frame is bisected, attributed, and its avoidable cost fixed
- [A read moves a small group consumer](/quest/m1/release-perf/group-consumer-size.md) - `group::Consumer` shrinks from 280 bytes, so a read stops copying it through every layer

## Related

Expand Down
21 changes: 0 additions & 21 deletions quest/m1/release-perf/group-consumer-size.md

This file was deleted.

3 changes: 1 addition & 2 deletions quest/m1/release-perf/relay-cpu-bisect.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Decided 2026-11-03 (maintainer, on [moq-dev/moq#7605](https://github.com/moq-dev
- ✅ A follow-up at m0, as a correctness bug: [a waiter's record limit changes no behavior](/quest/m0/kio-waiter-records.md).
- Leave the limit at 8.
3. `group::Consumer` moves:
- ✅ A follow-up in this epic: [a read moves a small group consumer](/quest/m1/release-perf/group-consumer-size.md).
- ✅ A follow-up in this epic, implemented in [moq-dev/moq#7791](https://github.com/moq-dev/moq/pull/7791).
- Leave it.

Remaining:
Expand All @@ -55,7 +55,6 @@ Public API: none expected. Wire: none.
## Related

- [A waiter's record limit changes no behavior](/quest/m0/kio-waiter-records.md) - found here; the session's waiter registration cost waits on it
- [A read moves a small group consumer](/quest/m1/release-perf/group-consumer-size.md) - found here; the session's largest remaining self cost

- [Calibrate the paired nightly benchmarks](/quest/m1/bench-ci.md) - the nightly series that should have caught this growth
- [Performance audit](/quest/m2/audit-perf.md) - counts instructions when bisecting, for the same reason
11 changes: 7 additions & 4 deletions rs/moq-net/benches/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
//! as a slope. Unwatched broadcasts stay announced and silent: their cost is the
//! route table they occupy, not a publisher writing into its own cache.
//!
//! `SESSION_ALLOCS=1` prints allocations, allocated bytes and, where Linux perf counters are
//! readable, user instructions per viewer-group or delivered datagram instead of timing.
//! `SESSION_ALLOCS=1` prints the group consumer size, allocations, allocated bytes and,
//! where Linux perf counters are readable, user instructions per viewer-group or delivered
//! datagram instead of timing.
//! `SESSION_CPU=1` measures thread CPU time on Unix instead of elapsed time, excluding
//! preemption while retaining all protocol work on this current-thread runtime. CPU-timed
//! groups have a `_cpu` suffix. Cache-clock advancement remains outside both clocks.
Expand Down Expand Up @@ -1487,11 +1488,13 @@ fn dash<B: Backend>(c: &mut Criterion, name: &str, shapes: impl IntoIterator<Ite
group.finish();
}

/// Print allocations, allocated bytes and, given perf access, user instructions per
/// viewer-group or per delivered datagram instead of timing, to compare across revisions.
/// Print Consumer size, allocations, allocated bytes and, given perf access, user
/// instructions per viewer-group or delivered datagram, to compare across revisions.
fn allocations<B: Backend>() {
const ROUNDS: usize = 256;

println!("group::Consumer: {} bytes", size_of::<moq_net::group::Consumer>());

let rt = runtime();
let fanout = Shape {
publishers: 1,
Expand Down
8 changes: 4 additions & 4 deletions rs/moq-net/src/model/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ pub(super) enum Source {
pub(super) struct Expiry {
policy: Arc<dyn group::Expiry>,
stale_stats: stats::Meter,
stale_counted: Arc<AtomicBool>,
delivery: Arc<group::Delivery>,
tail: Range<usize>,
count_payload: bool,
}
Expand All @@ -1474,12 +1474,12 @@ impl Expiry {
pub(super) fn new(
policy: Arc<dyn group::Expiry>,
stale_stats: stats::Meter,
stale_counted: Arc<AtomicBool>,
delivery: Arc<group::Delivery>,
) -> Self {
Self {
policy,
stale_stats,
stale_counted,
delivery,
tail: 0..0,
count_payload: false,
}
Expand Down Expand Up @@ -1663,7 +1663,7 @@ impl Consumer {
}

self.expired = true;
if !expiry.stale_counted.swap(true, Ordering::Relaxed) {
if !expiry.delivery.stale_counted.swap(true, Ordering::Relaxed) {
let mut stale = self.state.read().content_range(expiry.tail.start, expiry.tail.end);
if expiry.count_payload {
stale.bytes += self.size().saturating_sub(self.read_idx) as u64;
Expand Down
Loading
Loading