perf: sequential fetch of `InRelease`

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

Start in internal/archive/archive.go and trace how setupIndexes calls fetchRelease for each suite, including signature verification and parsing. The issue proposes concurrent suite fetches; first check the existing archive tests and how they cover suite setup. Done means fetching the configured suites concurrently while preserving verification and parsing behavior, with tests covering the result.

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

説明

context

a cache-hot chisel cut of one small slice takes about 0.6-1.2s, and most of that is three InRelease round trips done one after another. setupIndexes (internal/archive/archive.go) loops over the suites in order and for each one fetchRelease downloads InRelease, verifies the signature and parses it before the next suite starts. with suites: [resolute, resolute-security, resolute-updates] that is three sequential https requests to the archive, 0.1-0.45s each depending on the archive's mood.

three runs of the same hot (🌶️) cut of python3-yaml_libs:

                       mean     std  <- 3 runs
suite details x3      530ms   290ms  InRelease fetch, verify, parse; sequential
index fetch x6         80ms    20ms  cache hits, parse
deb fetch + extract   260ms    20ms  cache hits
total                   ~1s  ~300ms

so 40-70% of a warm cut is waiting on 3 serial InRelease's. for a single image build it is a second, however for anything that cuts many times against one checkout it is the fixed cost of every cut (can you see a theme to my recent issues yet... 😅 non-contrived non-un-release example could be the chisel-releases ci though).

also, this gets worse with worse network (O(N) but git grad >1 so 150ms of lag will incur ~S*lag cost where S is n-of-suites aka ~3)

                     mean   std
direct (~40ms)      600ms  30ms
proxy +150ms        1.30s  80ms
proxy +300ms        1.77s  30ms

proposal

fetch the suites concurrently.

the suite's main and universe Packages could be fetched concurrently too, which matters on a cold cache (two ~75MB downloads per suite).

optionally, we could start a spiritual successor of the discussion from #254 and honour Valid-Until for InRelease files.

主要言語
Go
スター
434
フォーク
74
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

canonical/chisel のほかの issue

canonical/chisel の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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