Files
openidea/perf/rust.ts
T
Mr0Bread 34cb4ad5e0 fix(bench): preserve failed trials and bound cleanup (#4489)
Failed warmups and repetitions were dropped from benchmark summaries, a failed startup, build or cleanup could leave an earlier success report in place, and a hung renderer or child process could block a run. Every attempt now keeps its status, metrics and error so summaries have the complete denominator; failures replace stale reports; browser and child-process lifecycles are bounded with cleanup of owned resources; and each criterion execution gets its own artifact directory.

Co-authored-by: Mr0Bread <55754540+Mr0Bread@users.noreply.github.com>
2026-11-19 19:38:34 +08:00

32 lines
1.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Backend performance gate: runs the criterion benches of the crates on the
* interactive path and checks their means (µs) against `budgets.json` › rust
* and the local baseline.
*
* pnpm perf:rust run benches, then check
* pnpm perf:rust -- --no-run inspect recorded results (no execution)
* pnpm perf:rust -- --package ide-text --save-baseline
*/
import { resolve } from "node:path";
import { parseArgs } from "node:util";
import { runRust } from "./lib/rustRun.ts";
const ROOT = resolve(import.meta.dirname, "..");
const { values: args } = parseArgs({
options: {
package: { type: "string", multiple: true },
"no-run": { type: "boolean", default: false },
"save-baseline": { type: "boolean", default: false },
"fail-on-regression": { type: "boolean", default: false },
},
});
process.exitCode = await runRust({
root: ROOT,
packages: args.package,
noRun: args["no-run"],
saveBaseline: args["save-baseline"],
failOnRegression: args["fail-on-regression"],
});