Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
Merge 577761b into a6b4920
Browse files Browse the repository at this point in the history
  • Loading branch information
helio-frota committed Nov 2, 2016
2 parents a6b4920 + 577761b commit 25f7263
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ before_script:
- npm install -g coveralls
script:
- make ci
- npm run benchmark
- npm run benchmark2
branches:
only:
- master
Expand Down
22 changes: 22 additions & 0 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

const util = require('util');
const Benchmark = require('benchmark');
const LightBright = require('../index');
const Timing = LightBright.builtins.timing;
LightBright.addFilter(Timing.timer);
LightBright.enable();

function a () {
util.inspect({foo: 1});
let t = Timing.timings(); // eslint-disable-line
}

const suite = Benchmark.Suite();
suite
.add('With lightbright', a)
.on('cycle', (event) => console.log(String(event.target)))
.on('complete', () => {
LightBright.disable();
})
.run({ 'async': true });
15 changes: 15 additions & 0 deletions benchmark/benchmark2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const util = require('util');
const Benchmark = require('benchmark');

function a () {
util.inspect({foo: 1});
}

const suite = Benchmark.Suite();
suite
.add('Without lightbright', a)
.on('cycle', (event) => console.log(String(event.target)))
.on('complete', () => { })
.run({ 'async': true });
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"lint": "eslint lib/*.js test/*.js index.js",
"test": "istanbul cover test/runner.js",
"prepublish": "nsp check",
"ci": "make ci"
"ci": "make ci",
"benchmark": "node benchmark/benchmark.js",
"benchmark2": "node benchmark/benchmark2.js"
},
"keywords": [
"AsyncWrap",
Expand All @@ -22,6 +24,8 @@
"license": "Apache-2.0",
"devDependencies": {
"async": "^2.0.0-rc.6",
"bench": "^0.3.6",
"benchmark": "^2.1.2",
"cli-color": "^1.1.0",
"eslint": "^3.3.1",
"eslint-config-semistandard": "^7.0.0-beta.0",
Expand Down

0 comments on commit 25f7263

Please sign in to comment.