Synopsis
No fuss benchmarking for Node.js.
Usage
var Benchpress = require('@mariocasciaro/benchpress');
var suite = new Benchpress({
});
suite
.add('Benchmark name', {
beforeAll: function() {
},
beforeEach: function() {
},
fn: function() {
},
afterEach: function() {
},
afterAll: function() {
}
})
.add('Async benchmark', function() {
beforeAll: function(done) {
done();
},
fn: function(done) {
done();
},
afterEach: function(done) {
done();
},
iterations: 300
})
.run();
The code above will print in the console something like this:
Starting suite.
Benchmark 'Benchmark name': 374812 ops/sec (1000 iterations)
Benchpress 'Async benchmark': 126432 ops/sec (300 iterations)
Run complete.