node-24-bench becomes a two-entry matrix that restores the node-24-build output, bundles only the benchmark workers, and runs one suite phase per idle runner: phase first holds the corpus cases and phase last the serial files listed in SERIAL_BENCH_FILES. Each phase uploads its results.jsonl and the measuring environment; node-24-bench-report renders one benchmark-report on a small runner under Node type stripping and stays out of all-checks-passed.
22 lines
823 B
TypeScript
22 lines
823 B
TypeScript
/**
|
|
* Benchmark suite phases, kept free of build-tool imports so gate selection can
|
|
* validate a phase without loading the TypeScript compiler.
|
|
*/
|
|
|
|
/** One phase of the suite: `first` runs the corpus cases, `last` runs the serial files of `run-bench-suite.ts`. */
|
|
export type BenchPhase = 'first' | 'last'
|
|
|
|
/** Which part of the report a phase invocation owns; `all` clears and renders on its own. */
|
|
export type BenchReportPhase = BenchPhase | 'all'
|
|
|
|
/**
|
|
* Parse a benchmark phase name.
|
|
* @param raw - the requested phase.
|
|
* @returns the phase.
|
|
* @throws If the value is not `first` or `last`.
|
|
*/
|
|
export function parseBenchPhase(raw: string | undefined): BenchPhase {
|
|
if (raw === 'first' || raw === 'last') return raw
|
|
throw new Error(`benchmark phase must be "first" or "last", got ${JSON.stringify(raw)}.`)
|
|
}
|