Skip to content

perf(ci): surface keyed-list allocation in the /perf comment#702

Merged
azchohfi merged 1 commit into
mainfrom
perf-keyed-alloc-table
Jun 26, 2026
Merged

perf(ci): surface keyed-list allocation in the /perf comment#702
azchohfi merged 1 commit into
mainfrom
perf-keyed-alloc-table

Conversation

@azchohfi

Copy link
Copy Markdown
Collaborator

What

The keyed-list /perf leg (StressPerf.KeyedList) already captures the full allocation set in metrics.json (allocBytesPerRender, gen0PerKRenders) via the shared PerfTracker, but Format-PerfKeyedListSection rendered only the four headline metrics — so the keyed-diff allocation signal was invisible in the comment.

This adds an Allocation (keyed-list) sub-table inside the keyed-list section, reusing the existing $PerfAllocMetricSpec over the keyed aggregates with the identical paired-Δ 95% CI machinery as the headline and StocksGrid allocation tables.

Allocation on the keyed (ReconcileKeyedReconcileKeyedMiddle / LIS) path scales with reorder volume in a way the positional StocksGrid allocation table can never isolate — the exact signal keyed-diff alloc-reduction work (e.g. #657) needs measured.

Why it's safe

  • Pure render reuse — no workload, harness, or metrics.json change. The keyed aggregates already carry AllocBytesPerRender / Gen0PerKRenders (+ Spread / Samples) via Measure-PerfRuns, exactly like the StocksGrid leg.
  • Gated on the keyed leg reporting alloc metrics (n/a for a legacy head), mirroring the StocksGrid alloc table's $hasAlloc guard.
  • Footprint: 3 files, all tests/stress_perf/ci/**, 0 src/Reactor (Class-B harness-only).

Rendered output

Below the keyed headline metrics, the section now shows (real magnitudes from a StressPerf.KeyedList @50% run, alloc reduced ~20%):

Allocation (keyed-list) — lower is better

Metric main This PR Δ (95% CI) Status
Alloc bytes/render ↓ 328000 262000 -20.1% ✅ improvement
Gen0 GC / 1k renders ↓ 63.20 50.20 -20.6% ✅ improvement

Tests

+8 assertions in PerfLib.Tests.ps1: sub-table renders, bytes/render + Gen0 rows present, alloc-down reads improvement, ordering after the headline table, omitted when keyed aggregates lack alloc, and distinct from the StocksGrid Allocation (Reactor) table in a full comment. PerfLib.Tests 226 green; RunPerfBenchmark.Tests 39 green.


Part of the "make /perf valuable" harness roadmap (follows PR1–PR4 + #700). Class-B harness-only.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Surfaces allocation metrics for the keyed-list /perf leg (StressPerf.KeyedList) in the rendered PR comment by adding an allocation sub-table to the keyed-list section, using the existing allocation metric spec and the same paired-Δ 95% CI machinery already used elsewhere in the perf comment.

Changes:

  • Extend Format-PerfKeyedListSection to append an Allocation (keyed-list) markdown table (Alloc bytes/render, Gen0 GC / 1k renders) when allocation metrics are present.
  • Add PowerShell unit tests to verify the keyed allocation sub-table renders/omits correctly and remains distinct from the StocksGrid allocation table.
  • Update the perf CI README to document the new keyed allocation sub-table and its intent.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/stress_perf/ci/PerfLib.ps1 Adds a keyed-list allocation sub-table to the keyed-list section, gated on alloc metrics being present.
tests/stress_perf/ci/PerfLib.Tests.ps1 Adds assertions covering rendering, ordering, omission gating, and distinction from the StocksGrid allocation table.
tests/stress_perf/ci/README.md Documents that keyed-list output includes its own allocation sub-table and when it appears.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The keyed-list leg (StressPerf.KeyedList) already captures the full alloc set
in metrics.json (allocBytesPerRender, gen0PerKRenders) via the shared
PerfTracker, but Format-PerfKeyedListSection rendered only the four headline
metrics, so the keyed-DIFF allocation signal was invisible. Allocation on the
keyed (ReconcileKeyed -> ReconcileKeyedMiddle / LIS) path scales with reorder
volume in a way the positional StocksGrid allocation table can never isolate;
that signal is exactly what keyed-diff alloc-reduction work needs measured.

Render an "Allocation (keyed-list)" sub-table inside the keyed section, reusing
the existing $PerfAllocMetricSpec over the keyed aggregates with the identical
paired-delta 95% CI machinery as the headline + StocksGrid alloc tables. Gated
on the keyed leg reporting alloc metrics (n/a for a legacy head). Pure render
reuse, no workload or metrics.json change.

Tests: +8 assertions in PerfLib.Tests.ps1 (sub-table renders, bytes/render +
Gen0 rows, alloc-down reads improvement, ordering after the headline table,
omitted when keyed aggregates lack alloc, and distinct from the StocksGrid
"Allocation (Reactor)" table in a full comment). PerfLib.Tests 226 green.

Docs: ci/README.md keyed-list bullet + the Format-PerfKeyedListSection doc-comment
and tests/stress_perf/METHODOLOGY.md keyed-list section synced to mention the
allocation sub-table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@azchohfi azchohfi marked this pull request as ready for review June 26, 2026 13:53
@azchohfi azchohfi merged commit 0ffd8ce into main Jun 26, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants