Benchmark every PR on deterministic costs, with on-demand stable-hardware runs and a results history

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, github-actions, go

調査の方向性

Start by inventorying the Go micro-benchmarks, tests/performance, tests/stress, tests/resources, tests/enry-performance, and BenchmarkProfileScanner, then inspect how CI currently runs them. Use the related #89 and #75 proposals to clarify dependencies. Done means the three benchmark tiers, matching local target, public history and regression reporting are implemented without a schedule trigger.

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

説明

enhancement follow-up

Why

The raw material exists, but nothing watches performance continuously:

  • 16 Go micro-benchmarks, none run in CI;
  • BenchmarkProfileScanner, with pprof capture, disabled unless DIRCUE_PROFILE_ROOT is set;
  • Docker-based harnesses (tests/performance against Linguist, tests/stress, tests/resources with cgroup limits, tests/enry-performance), all run by hand, with results committed as JSON.

There is no history, no baseline comparison and no alerting. That's how the Git-path cliff (#73) shipped unnoticed: 23.5 s vs 6.5 s for the language pass, and 205.6 s vs 6.7 s for metrics, on the Linux kernel.

Shared CI runners are too noisy for wall-time gates (±20% is common), so the design splits into what is deterministic and what needs stable hardware. All of it is event-driven: nothing runs on a schedule (#92).

Proposal: three tiers

  1. Every PR (hosted runners, noise-free signals).
    • Logical-work counters (#89) on small pinned fixtures, gated against committed budgets. Physical costs are gated only under a pinned pack layout and controlled cache conditions, e.g. a small delta-replay fixture with an explicit byte-amplification budget.
    • Go micro-benchmarks compared with benchstat against the merge base, gating on allocs/op and B/op, which are stable on shared runners.
    • Wall time reported but not gated.
  2. On demand (stable hardware). A workflow_dispatch-only workflow, plus a local make target that produces the same result format. It targets a self-hosted runner label when a dedicated, quiet machine exists (self-hosted runners are free for public repositories), and runs macro-benchmarks on the golden corpus (#75):
    • N repeated runs per case, covering both source modes (Git and directory), each preset, and key modules;
    • wall time, CPU, peak RSS and bytes read;
    • pprof profiles archived.
    • Each run appends to a public history (e.g. github-action-benchmark to GitHub Pages, or Bencher). Regressions are detected statistically against the previous recorded runs and reported on the run, or by opening an issue.
  3. Release.
    • The full matrix against the previous release, Linguist and scc.
    • Constrained-resource runs (cgroup memory and CPU limits) that prove each preset's and memory ceiling's claims.
    • BENCHMARKS.md regenerated from data.

Budgets. Publish per-corpus-entry targets for reference hardware, e.g. the kernel language pass from Git, peak RSS, and analyze all time, and check them at release.

Acceptance

  • PR-tier counter and allocation gates live in CI.
  • On-demand stable-hardware workflow (workflow_dispatch only) and a matching local target, feeding a public history with regression detection. No schedule: trigger.
  • Release-tier report generated automatically and attached to each release.
  • Existing harnesses (tests/performance, tests/resources, BenchmarkProfileScanner) folded into the tiers rather than duplicated.

Related: #39 (optimization campaign methodology), #73.

Part of the 1.0 quality program: #83. Epic: #81.

主要言語
Go
スター
0
フォーク
0
平均マージ
11時間 3分
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

war-and-code/dircue のほかの issue

war-and-code/dircue の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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