Measure and reduce JS group-expiry checks when several reads are stalled

Abierto
#10,267 1 comentario 1 reacción 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
46/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
performance

Línea de trabajo

Start with the linked benchmark at js/net/bench/track.ts, then read the subscriber guard in js/net/src/track.ts and expiry listeners in js/net/src/group.ts. Hold the clock step, budget, retention and open groups fixed while varying stalled groups and subscribers; count eligibility checks, reader wakeups and expirations per delivered group. Done means identifying whether unchanged verdicts cause excess work and confirming prompt expiry and on-time delivery after any change.

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

Descripción

In the last two Nightly track sweeps, publishing and delivering one new group to 16 subscribers with 16 earlier group reads parked per subscriber took 4.63 and 4.87 ms. With the same subscriber count and 16 pending stream opens per subscriber it took 3.01 and 3.19 ms. With no parked reads it took 0.146 and 0.156 ms. These rows retain 100 groups. The held rows also use a longer media budget and a different clock step, so the full difference needs a matched control before it can be attributed to expiry checks. Track benchmark · Latest measurements, raw/track.csv · Previous measurements

Each held group’s verdict depends on several signals shared by its subscriber, including the group queue, timeline and cursor. A new arrival can make many parked reads reconsider their budgets even when all remain usable. Stream-open waits watch the same verdict through GivenUp. Subscriber guard · Expiry listeners

A local control on the linked source kept 16 earlier groups open, the same consumer handles alive, the same clock step and media budget, and the same 100-group setup in all three cases. Counting calls to the expired() predicate passed through hooks.expireGroup over 30 new groups per case gave the following counts on each of three rotated runs:

Subscribers Earlier groups open, no parked operation Parked reads Parked stream opens
1 32 64 64
4 128 256 256
16 512 1,024 1,024

Each cell counts checks per new group published to all subscribers. At 16 subscribers the median elapsed times with the counter enabled were 1.60, 3.43 and 1.94 ms per new group, respectively. The open-group control itself does substantial work, so profile it alongside the parked operations.

Hold the clock step, budget, retention and number of open groups fixed. Vary the number of stalled groups and subscribers independently, including open groups with no parked read. Count eligibility checks, reader wakeups and actual expirations per delivered group. If most checks leave the verdict unchanged, compare the current listeners with computing the shared drift inputs once per subscriber revision and revisiting only groups whose verdict can change. Check that a group still expires promptly on a deadline, a new live edge or a budget change, and that a healthy subscriber keeps receiving on time.

(Written by GPT-6.2 Astra with xhigh)

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.