[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

ref(bench): return promise

Nate Moore (May 31, 2026, 11:28 PM -0500) 8dbac096 a26f3283

+10 -12
+8 -6
bench/fixtures/utils.ts
··· 1 1 import { fileURLToPath } from "node:url"; 2 - import { spawnSync } from "node:child_process"; 2 + import { spawn } from "node:child_process"; 3 3 4 4 export const fixture = (name: string) => { 5 5 return new URL(`./${name}/mod.ts`, import.meta.url); 6 6 }; 7 7 8 - export const spawnFixture = (name: string) => 9 - spawnSync(process.execPath, [ 10 - ...process.execArgv, 11 - fileURLToPath(fixture(name)), 12 - ], { stdio: "ignore" }); 8 + export const spawnFixture = (name: string): Promise<void> => 9 + new Promise((resolve) => { 10 + spawn(process.execPath, [ 11 + ...process.execArgv, 12 + fileURLToPath(fixture(name)), 13 + ], { stdio: "ignore" }).on("close", resolve); 14 + });
+2 -6
bench/startup.bench.ts
··· 5 5 let bench = withCodSpeed(new Bench({ name: "startup" })); 6 6 7 7 bench 8 - .add("createTerm", async () => { 9 - spawnFixture("create-term"); 10 - }) 11 - .add("time to first render", async () => { 12 - spawnFixture("render-minimal"); 13 - }); 8 + .add("createTerm", () => spawnFixture("create-term")) 9 + .add("time to first render", () => spawnFixture("render-minimal")); 14 10 15 11 await bench.run(); 16 12 console.table(bench.table());