xonecas.io
70160
Ce

cel-tui / files

cel-tui / benchmarks / run-all.ts

1.1 KB
1/**
2 * Run all cel-tui benchmarks sequentially.
3 *
4 * Usage: bun run benchmarks/run-all.ts
5 *
6 * Individual benchmarks can be run directly:
7 *   bun run benchmarks/width.bench.ts
8 *   bun run benchmarks/layout.bench.ts
9 *   bun run benchmarks/paint.bench.ts
10 *   bun run benchmarks/cell-buffer.bench.ts
11 *   bun run benchmarks/hit-test.bench.ts
12 *   bun run benchmarks/keys.bench.ts
13 *   bun run benchmarks/e2e.bench.ts
14 *   bun run benchmarks/real-world.bench.ts
15 */
16
17import { $ } from "bun";
18
19const benchmarks = [
20  "width",
21  "layout",
22  "paint",
23  "cell-buffer",
24  "hit-test",
25  "keys",
26  "e2e",
27  "real-world",
28];
29
30console.log("cel-tui benchmark suite");
31console.log("=".repeat(60));
32console.log();
33
34for (const name of benchmarks) {
35  console.log(`\n${"─".repeat(60)}`);
36  console.log(`  ${name}`);
37  console.log(`${"─".repeat(60)}\n`);
38  await $`bun run benchmarks/${name}.bench.ts`.quiet().then(
39    (result) => process.stdout.write(result.stdout),
40    (err) => {
41      process.stderr.write(err.stderr);
42      process.exit(1);
43    },
44  );
45}
46
47console.log("\nAll benchmark groups completed successfully.");