Files
oxc-project__oxc/.github/scripts/generate-benchmark-matrix.js
Boshen d174661221 ci(benchmark): add CodSpeed memory measurement for pipeline benchmarks (#24559)
Adds CodSpeed's [Memory Instrument](https://codspeed.io/docs/instruments/memory) for the `pipeline` benchmarks: peak memory, total allocated bytes, allocation count, and a memory timeline per benchmark case, tracked with baseline comparison on PRs alongside the existing CPU simulation runs.

## Changes

- `generate-benchmark-matrix.js`: entry construction is factored into a `buildMatrixEntries()` helper used by all five construction sites. All entries now carry an explicit `mode`: `simulation` for every component, `simulation,memory` for `pipeline` — so the pipeline job runs both instruments and inherits the existing changed-file affection logic.
- `benchmark.yml`: the action's `mode:` input comes from the matrix. Job names and count are unchanged.

No build-step changes needed: `cargo-codspeed` maps memory mode to the same `analysis` build the workflow already stages (`MeasurementMode::Memory` → `BuildMode::Analysis`), and the pinned action v4.18.5 supports memory mode (added in v4.17.0) including comma-separated multi-mode runs.

Notes:

- The first memory numbers on this PR will have no baseline; comparisons start after the post-merge main run.
- Memory metrics reflect the bench crate's deliberate `NeverGrowInPlaceAllocator` worst-case realloc behavior — consistent run-to-run, which is what matters for regression tracking.

AI Disclosure: This was generated with Claude Code, Fable 5. It has been tested and reviewed by me for correctness.
2026-07-15 16:12:52 +00:00

6.3 KiB
Executable File