moq-net: the 2 KiB whole-frame copy doesn't reduce recv64k's retained heap

Aperta
#10,325 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
performance

Direzione di ricerca

Start with rs/moq-net/benches/backing.rs and rs/moq-net/src/coding/reader.rs, then run the listed Criterion command with BACKING_ALLOCS=1 to reproduce the retained heap measurements. Trace which receive slices remain alive when frames span packets and compare the results with COPY_WHOLE enabled and disabled. Done means identifying what retains the allocations and either correcting the copy behavior or fixing the bench's claim.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

rs/moq-net/benches/backing.rs says the frame reader's whole-frame copy (COPY_WHOLE, 2 KiB, in rs/moq-net/src/coding/reader.rs) keeps every receive backing near the exact control. Measured on main, it doesn't for recv64k, and setting COPY_WHOLE to 0 lowers the retained heap.

Main's Criterion bench, BACKING_ALLOCS=1 cargo bench -p moq-net --features fuzz --bench backing -- tracks=1/video=150k, on x86_64 Linux at c70609d534:

case retained (copy on) retained (COPY_WHOLE = 0)
keep=all/exact 409031 B (1.08x pool) 409031 B (1.08x)
keep=all/recv64k 670415 B (1.77x) 568787 B (1.50x)
keep=none/exact 179960 B (1.18x) 179960 B (1.18x)
keep=none/recv64k 437200 B (2.86x) 424024 B (2.77x)

The swole port in moq-dev/moq#9854 (backing and evicted, retained_bytes) reads the same numbers to within about 2 KiB.

At 150 kbps, the delta and audio frames that arrive whole are copied, yet every 64 KiB receive allocation apparently still stays alive. Possibly something else keeps a slice of it, such as a frame that spans packets taken with copy_to_bytes (zero-copy for a Bytes lease), so the copies only add their own bytes. Worth finding out what holds the allocations, then fixing the copy or the bench's claim.

(Written by Claude Opus 5.5 with high)

Lingua principale
Rust
Stelle
1.6k
Fork
251
Merge medio
10h 10m
PR unite (30g)
832

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di moq-dev/moq

Tutte le issue di moq-dev/moq

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.