aboutsummaryrefslogtreecommitdiff
path: root/benchmark/common.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-02-24 22:30:10 -0800
committerRich Trott <rtrott@gmail.com>2016-02-27 20:15:17 -0800
commitdcfda1007bb74a8354a47852bebe830a23916b6d (patch)
treec2c21681a7c0fa25bf74c8ecaaa0c19c5a3e6316 /benchmark/common.js
parent7fc6645982855ced40bf4af4b002a30b30510ac0 (diff)
downloadandroid-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.tar.gz
android-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.tar.bz2
android-node-v8-dcfda1007bb74a8354a47852bebe830a23916b6d.zip
tools,benchmark: increase lint compliance
In the hopes of soon having the benchmark code linted, this change groups all the likely non-controversial lint-compliance changes such as indentation, semi-colon usage, and single-vs.-double quotation marks. Other lint rules may have subtle performance implications in the V8 currently shipped with Node.js. Those changes will require more careful review and will be in a separate change. PR-URL: https://github.com/nodejs/node/pull/5429 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'benchmark/common.js')
-rw-r--r--benchmark/common.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/benchmark/common.js b/benchmark/common.js
index 1ff4b50f8a..d1bc985f09 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -28,7 +28,7 @@ if (module === require.main) {
var tests = fs.readdirSync(dir);
if (testFilter) {
- var filteredTests = tests.filter(function(item){
+ var filteredTests = tests.filter(function(item) {
if (item.lastIndexOf(testFilter) >= 0) {
return item;
}
@@ -49,7 +49,7 @@ function hasWrk() {
if (result.error && result.error.code === 'ENOENT') {
console.error('Couldn\'t locate `wrk` which is needed for running ' +
'benchmarks. Check benchmark/README.md for further instructions.');
- process.exit(-1);
+ process.exit(-1);
}
}
@@ -87,7 +87,7 @@ function Benchmark(fn, options) {
this.options = options;
this.config = parseOpts(options);
this._name = require.main.filename.split(/benchmark[\/\\]/).pop();
- this._start = [0,0];
+ this._start = [0, 0];
this._started = false;
var self = this;
@@ -121,7 +121,7 @@ Benchmark.prototype.http = function(p, args, cb) {
if (code) {
console.error('wrk failed with ' + code);
- process.exit(code)
+ process.exit(code);
}
var match = out.match(regexp);
var qps = match && +match[1];
@@ -141,8 +141,6 @@ Benchmark.prototype._run = function() {
// some options weren't set.
// run with all combinations
var main = require.main.filename;
- var settings = [];
- var queueLen = 1;
var options = this.options;
var queue = Object.keys(options).reduce(function(set, key) {
@@ -210,7 +208,7 @@ function parseOpts(options) {
});
}
return num === 0 ? conf : null;
-};
+}
Benchmark.prototype.start = function() {
if (this._started)
@@ -228,8 +226,8 @@ Benchmark.prototype.end = function(operations) {
if (typeof operations !== 'number')
throw new Error('called end() without specifying operation count');
- var time = elapsed[0] + elapsed[1]/1e9;
- var rate = operations/time;
+ var time = elapsed[0] + elapsed[1] / 1e9;
+ var rate = operations / time;
this.report(rate);
};