diff options
author | Rich Trott <rtrott@gmail.com> | 2016-02-24 22:30:10 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-02-27 20:15:17 -0800 |
commit | dcfda1007bb74a8354a47852bebe830a23916b6d (patch) | |
tree | c2c21681a7c0fa25bf74c8ecaaa0c19c5a3e6316 /benchmark/http | |
parent | 7fc6645982855ced40bf4af4b002a30b30510ac0 (diff) | |
download | android-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/http')
-rw-r--r-- | benchmark/http/_chunky_http_client.js | 7 | ||||
-rw-r--r-- | benchmark/http/chunked.js | 1 | ||||
-rw-r--r-- | benchmark/http/end-vs-write-end.js | 1 | ||||
-rw-r--r-- | benchmark/http/http_server_for_chunky_client.js | 12 | ||||
-rw-r--r-- | benchmark/http/simple.js | 1 |
5 files changed, 9 insertions, 13 deletions
diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js index 24e14ca2bc..158be5a0eb 100644 --- a/benchmark/http/_chunky_http_client.js +++ b/benchmark/http/_chunky_http_client.js @@ -15,7 +15,6 @@ var bench = common.createBenchmark(main, { function main(conf) { var len = +conf.len; var num = +conf.num; - var type = conf.type; var todo = []; var headers = []; // Chose 7 because 9 showed "Connection error" / "Connection closed" @@ -24,7 +23,7 @@ function main(conf) { headers.push(Array(i + 1).join('o')); function WriteHTTPHeaders(channel, has_keep_alive, extra_header_count) { - todo = [] + todo = []; todo.push('GET / HTTP/1.1'); todo.push('Host: localhost'); todo.push('Connection: keep-alive'); @@ -63,7 +62,7 @@ function main(conf) { var socket = net.connect(PIPE, function() { bench.start(); WriteHTTPHeaders(socket, 1, len); - socket.setEncoding('utf8') + socket.setEncoding('utf8'); socket.on('data', function(d) { var did = false; var pattern = 'HTTP/1.1 200 OK\r\n'; @@ -73,7 +72,7 @@ function main(conf) { success += 1; did = true; } else { - pattern = 'HTTP/1.1 ' + pattern = 'HTTP/1.1 '; if ((d.length === pattern.length && d === pattern) || (d.length > pattern.length && d.slice(0, pattern.length) === pattern)) { diff --git a/benchmark/http/chunked.js b/benchmark/http/chunked.js index 9743bc1d6f..642f2962cd 100644 --- a/benchmark/http/chunked.js +++ b/benchmark/http/chunked.js @@ -9,7 +9,6 @@ 'use strict'; var common = require('../common.js'); -var PORT = common.PORT; var bench = common.createBenchmark(main, { num: [1, 4, 8, 16], diff --git a/benchmark/http/end-vs-write-end.js b/benchmark/http/end-vs-write-end.js index d6b3ebe409..4e12e543f0 100644 --- a/benchmark/http/end-vs-write-end.js +++ b/benchmark/http/end-vs-write-end.js @@ -9,7 +9,6 @@ 'use strict'; var common = require('../common.js'); -var PORT = common.PORT; var bench = common.createBenchmark(main, { type: ['asc', 'utf', 'buf'], diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js index dede7daa7c..d85e15bcbe 100644 --- a/benchmark/http/http_server_for_chunky_client.js +++ b/benchmark/http/http_server_for_chunky_client.js @@ -4,8 +4,8 @@ var path = require('path'); var http = require('http'); var fs = require('fs'); var spawn = require('child_process').spawn; -var common = require('../common.js') -var test = require('../../test/common.js') +require('../common.js'); +var test = require('../../test/common.js'); var pep = path.dirname(process.argv[1]) + '/_chunky_http_client.js'; var PIPE = test.PIPE; @@ -38,17 +38,17 @@ try { child = spawn(process.execPath, [pep], { }); child.on('error', function(err) { - throw new Error('spawn error: ' + err ); + throw new Error('spawn error: ' + err); }); child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); - child.on('close', function (exitCode) { + child.on('close', function(exitCode) { server.close(); }); -} catch(e) { - throw new Error('error: ' + e ); +} catch (e) { + throw new Error('error: ' + e); } diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 835fa3d52f..5449c49be9 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -12,7 +12,6 @@ var bench = common.createBenchmark(main, { function main(conf) { process.env.PORT = PORT; - var spawn = require('child_process').spawn; var server = require('../http_simple.js'); setTimeout(function() { var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks; |