1.2.6 • Published 8 years ago
nperf v1.2.6
nperf
A minimalistic performance measurement util for Node.js.
Install
npm install nperf
Usage
Just require nperf and define your test cases.
const nperf = require('nperf');
nperf()
.test('Spread-Operator', () => {
const b = [4, 5, 6];
[1, 2, 3, ...b];
})
.test('Array.prototype.concat', () => {
const a = [1, 2, 3];
a.concat([4, 5, 6]);
})
.run();
Console output
Spread-Operator vs. Array.prototype.concat
1. Array.prototype.concat 2x (avg ~139.490ns)
2. Spread-Operator 1x (avg ~276.843ns)
API
TBD
Running tests
npm test
Coverage
npm install istanbul -g
npm run coverage
License
Released under the MIT license.