A zero-dependency micro-benchmark runner with statistical median, p90 calculation, and instant terminal ASCII bar charts.
Setting up large benchmark frameworks (like benchmark.js or tinybench) can be overkill when quickly comparing two algorithms or data structures.
bench-diff takes an exported dictionary of functions and runs high-resolution process.hrtime.bigint profiling with automatic warmup and statistical distributions.
Create bench.js:
export default {
"RegExp.test": () => /hello/.test("hello world"),
"String.includes": () => "hello world".includes("hello"),
};Run:
npx bench-diff bench.js --iterations 5000MIT © luckdevx