test(codemode): report the fastest run in benchmarks

This commit is contained in:
James Long
2026-11-04 20:10:58 +00:00
Unverified
parent 9c239c1b73
commit 252b78a768
+4 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bun
// Interpreter benchmarks: median wall-clock milliseconds per program over several runs.
// Interpreter benchmarks: median and fastest wall-clock milliseconds per program over several runs.
// Usage: bun run script/bench.ts [--iterations N] [--filter name]
import { Effect, Schema } from "effect"
@@ -106,5 +106,7 @@ for (const [name, code] of cases) {
await Effect.runPromise(runtime.execute(code))
times[index] = performance.now() - start
}
console.log(`${name.padEnd(28)} ${median(times).toFixed(1).padStart(8)} ms`)
console.log(
`${name.padEnd(28)} ${median(times).toFixed(1).padStart(8)} ms (min ${Math.min(...times).toFixed(1)} ms)`,
)
}