@indutny/bencher
Simple JavaScript benchmarking tool inspired by my bad understanding of how
Criterion.rs
works.
Disclaimer
Let's be honest, I'm terrible at statistics. This approach that I took here is
probably incorrect, but the results appear to be stable enough so I'm happy to
use it for my personal projects.
Any ideas on improving the algorithm are very welcome!
Installation
npm install -g @indutny/bencher
Usage
export const name = 'runner';
export default () => {
let sum = 0;
for (let i = 0; i < 1e6; i++) {
sum += i;
}
return sum;
};
$ bencher benchmark.js
runner: 1’037.8 ops/sec (±18.8, p=0.001, n=98)
LICENSE
This software is licensed under the MIT License.