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

オープン
#10,267 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
46/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
performance

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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)

主要言語
Rust
スター
1.6k
フォーク
251
平均マージ
10時間 10分
マージ済み PR(30日)
832

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

moq-dev/moq のほかの issue

moq-dev/moq の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。