simple-benchmarkjs-runner
A simple runner for benchmark.js. It abstracts the benchmark.js API and provides a config-like way to execute your benchmarking.
Installation
Install the lib:
$ npm install simple-benchmarkjs-runner --save-dev
Require it in your code:
;// orvar BenchmarkRunner = ;
API
Basic usage:
;;; title: 'benchmark-suite-title' tests: title: 'Implementation 1' fn: impl1 title: 'Implementation 2' { ; } ;
It also accepts an array of suite configs. They will run sequentialy:
title: 'benchmark-suite-title' tests: ... title: 'another-benchmark-suite-title' tests: ... ;
Execution
$ npm run benchmark
Output
It will benchmark the different implementations and it will output some stats:
Implementation 1 x 13,244 ops/sec ±6.60% (66 runs sampled)
Implementation 2 x 15,724 ops/sec ±3.05% (83 runs sampled)
Fastest is "Implementation 2"!
License
The MIT License (MIT)