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

Abierto
#10,325 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
performance

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
Rust
Estrellas
1.6k
Forks
251
Merge medio
10 h 10 min
PR fusionados (30 d)
832

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de moq-dev/moq

Todos los issues de moq-dev/moq

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.