summaryrefslogtreecommitdiff
path: root/benchmark/http
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-17 04:01:12 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-20 04:46:37 +0300
commit22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3 (patch)
tree255361bcfb0611af60f6c7c101c886687d0ce047 /benchmark/http
parentbbbb1f60780d9b8ef812769e215be830c4d968b8 (diff)
downloadandroid-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.tar.gz
android-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.tar.bz2
android-node-v8-22aa3d48997f1fc31e9c9cc08ec76a5436c93fe3.zip
benchmark: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12455 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/http')
-rw-r--r--benchmark/http/_chunky_http_client.js2
-rw-r--r--benchmark/http/cluster.js2
-rw-r--r--benchmark/http/http_server_for_chunky_client.js4
-rw-r--r--benchmark/http/simple.js3
4 files changed, 5 insertions, 6 deletions
diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js
index 55f914c6df..d235a5e04a 100644
--- a/benchmark/http/_chunky_http_client.js
+++ b/benchmark/http/_chunky_http_client.js
@@ -37,7 +37,7 @@ function main(conf) {
for (var i = 0; i < extra_header_count; i++) {
// Utilize first three powers of a small integer for an odd cycle and
// because the fourth power of some integers overloads the server.
- todo.push('X-Header-' + i + ': ' + headers[i % 3]);
+ todo.push(`X-Header-${i}: ${headers[i % 3]}`);
}
todo.push('');
todo.push('');
diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js
index 464bcfdb63..3a9392c422 100644
--- a/benchmark/http/cluster.js
+++ b/benchmark/http/cluster.js
@@ -27,7 +27,7 @@ function main(conf) {
return;
setTimeout(function() {
- var path = '/' + conf.type + '/' + conf.len;
+ var path = `/${conf.type}/${conf.len}`;
bench.http({
path: path,
diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js
index e58ba5f5a1..bdeb517344 100644
--- a/benchmark/http/http_server_for_chunky_client.js
+++ b/benchmark/http/http_server_for_chunky_client.js
@@ -6,7 +6,7 @@ var fs = require('fs');
var fork = require('child_process').fork;
var common = require('../common.js');
var test = require('../../test/common.js');
-var pep = path.dirname(process.argv[1]) + '/_chunky_http_client.js';
+var pep = `${path.dirname(process.argv[1])}/_chunky_http_client.js`;
var PIPE = test.PIPE;
try {
@@ -30,7 +30,7 @@ server = http.createServer(function(req, res) {
});
server.on('error', function(err) {
- throw new Error('server error: ' + err);
+ throw new Error(`server error: ${err}`);
});
server.listen(PIPE);
diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js
index c773e71791..81b7cb5afb 100644
--- a/benchmark/http/simple.js
+++ b/benchmark/http/simple.js
@@ -16,8 +16,7 @@ function main(conf) {
var server = require('../fixtures/simple-http-server.js')
.listen(process.env.PORT || common.PORT)
.on('listening', function() {
- var path = '/' + conf.type + '/' + conf.len + '/' + conf.chunks + '/' +
- conf.res;
+ var path = `/${conf.type}/${conf.len}/${conf.chunks}/${conf.res}`;
bench.http({
path: path,