diff --git a/benchmark/common.js b/benchmark/common.js index 158354004cd6bb..ecd88e46524670 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -60,7 +60,7 @@ function runBenchmarks() { if (test.match(/^[\._]/)) return process.nextTick(runBenchmarks); - if (outputFormat == 'default') + if (outputFormat === 'default') console.error(type + '/' + test); test = path.resolve(dir, test); @@ -160,7 +160,7 @@ Benchmark.prototype._run = function() { }, [[main]]); // output csv heading - if (outputFormat == 'csv') + if (outputFormat === 'csv') console.log('filename,' + Object.keys(options).join(',') + ',result'); var node = process.execPath; @@ -229,9 +229,9 @@ Benchmark.prototype.end = function(operations) { Benchmark.prototype.report = function(value) { var heading = this.getHeading(); - if (outputFormat == 'default') + if (outputFormat === 'default') console.log('%s: %s', heading, value.toFixed(5)); - else if (outputFormat == 'csv') + else if (outputFormat === 'csv') console.log('%s,%s', heading, value.toFixed(5)); process.exit(0); @@ -240,11 +240,11 @@ Benchmark.prototype.report = function(value) { Benchmark.prototype.getHeading = function() { var conf = this.config; - if (outputFormat == 'default') { + if (outputFormat === 'default') { return this._name + ' ' + Object.keys(conf).map(function(key) { return key + '=' + conf[key]; }).join(' '); - } else if (outputFormat == 'csv') { + } else if (outputFormat === 'csv') { return this._name + ',' + Object.keys(conf).map(function(key) { return conf[key]; }).join(','); diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 36800f2c9dba5a..915d34d0148b73 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -36,7 +36,7 @@ var server = module.exports = http.createServer(function (req, res) { var n_chunks = parseInt(commands[3], 10); var status = 200; - if (command == 'bytes') { + if (command === 'bytes') { var n = ~~arg; if (n <= 0) throw new Error('bytes called with n <= 0') @@ -45,7 +45,7 @@ var server = module.exports = http.createServer(function (req, res) { } body = storedBytes[n]; - } else if (command == 'buffer') { + } else if (command === 'buffer') { var n = ~~arg; if (n <= 0) throw new Error('buffer called with n <= 0'); @@ -57,7 +57,7 @@ var server = module.exports = http.createServer(function (req, res) { } body = storedBuffer[n]; - } else if (command == 'unicode') { + } else if (command === 'unicode') { var n = ~~arg; if (n <= 0) throw new Error('unicode called with n <= 0'); @@ -66,14 +66,14 @@ var server = module.exports = http.createServer(function (req, res) { } body = storedUnicode[n]; - } else if (command == 'quit') { + } else if (command === 'quit') { res.connection.server.close(); body = 'quitting'; - } else if (command == 'fixed') { + } else if (command === 'fixed') { body = fixed; - } else if (command == 'echo') { + } else if (command === 'echo') { res.writeHead(200, { 'Content-Type': 'text/plain', 'Transfer-Encoding': 'chunked' }); req.pipe(res); diff --git a/benchmark/http_simple_auto.js b/benchmark/http_simple_auto.js index f72cc01e60aa46..5d67d89dc91198 100644 --- a/benchmark/http_simple_auto.js +++ b/benchmark/http_simple_auto.js @@ -109,7 +109,7 @@ server.listen(port, function () { }); function dump_mm_stats() { - if (typeof gc != 'function') return; + if (typeof gc !== 'function') return; var before = process.memoryUsage(); for (var i = 0; i < 10; ++i) gc();