🏋️⛓ bench-chain
chainable benchmark recording - averages & graphs.
extension of benchmark.js
📦 install
yarn add bench-chainnpm i bench-chain --save
const Bench =
🌐 documentation
🔬 tests
📘 examples
👋 basic
const Bench = Bench // location to store benchmarks // tag current benchmarks with, to mark what changes caused differences tags'v1' // actual benchmarks
💍 async
const Bench = const sleep = Bench dir__dirnamefilename'asyncs.json' name'sleepy' tags'v1,v2' // can also use .add, and then .runAsync()
🚩 flags
--graph
will show only the graph reporting, rather than run the benchmarks--run-times=10
will run the test10
times
📇 metadata
🔋 battery parsing when available
- will be used for comparing more benchmark results with averages - amperage (number) - currentCapacity (number) - percent (number) - charging (boolean) - temp (number)- mem: operating system memory, nodejs memory
- num: operations a second from benchmarkjs hertz
- sampled: total runs samples from benchmarkjs
- variation: variation from benchmarkjs
- timesFor: microtime | performance.now times for beginning & end of each run
- now: Date.now for changes over time