From 6140b659a9a7a878cb8233e04a282e507f3390c0 Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 21 Sep 2026 04:39:03 +0000 Subject: [PATCH] Remove orphaned scripts/bench-runtime.ts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- scripts/bench-runtime.ts | 33 --------------------------------- tsconfig.tools.json | 1 - 2 files changed, 34 deletions(-) delete mode 100644 scripts/bench-runtime.ts diff --git a/scripts/bench-runtime.ts b/scripts/bench-runtime.ts deleted file mode 100644 index 03aa53fb..00000000 --- a/scripts/bench-runtime.ts +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bun -// Timing lever for CLI startup. Compare `node` vs `bun` on the built CLI. -import { spawnSync } from "node:child_process"; -import path from "node:path"; - -const root = process.cwd(); -const cli = path.join(root, "dist", "bin", "betterwright.js"); -const runtime = process.argv[2]; -const mode = process.argv[3] || "cli-help"; -if (!runtime) { - console.error("usage: bun scripts/bench-runtime.ts "); - process.exit(2); -} - -const args = mode === "cli-version" ? [cli, "--version"] : [cli, "--help"]; -const warmup = spawnSync(runtime, args, { cwd: root, encoding: "utf8" }); -if (warmup.status !== 0) { - console.error(warmup.stderr || warmup.stdout); - process.exit(warmup.status ?? 1); -} -const n = Number(process.env.BENCH_ITERS || 20); -const samples = []; -for (let i = 0; i < n; i++) { - const start = process.hrtime.bigint(); - const result = spawnSync(runtime, args, { cwd: root, encoding: "utf8" }); - const ms = Number(process.hrtime.bigint() - start) / 1e6; - if (result.status !== 0) process.exit(result.status ?? 1); - samples.push(ms); -} -samples.sort((a, b) => a - b); -const mean = samples.reduce((a, b) => a + b, 0) / samples.length; -const median = samples[Math.floor(samples.length / 2)]; -console.log(JSON.stringify({ runtime, mode, n, min: samples[0], median, mean })); diff --git a/tsconfig.tools.json b/tsconfig.tools.json index 0c83eea9..3bb66e76 100644 --- a/tsconfig.tools.json +++ b/tsconfig.tools.json @@ -29,7 +29,6 @@ "skipLibCheck": false }, "files": [ - "scripts/bench-runtime.ts", "scripts/build.ts", "scripts/check-build.ts", "scripts/check-package.ts",