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

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
performance

調査の方向性

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.

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

説明

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)

主要言語
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 を短くまとめたダイジェスト。