From cbd0be59f0adef929920fe6112c46b010d2e1eb7 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Sat, 9 Dec 2017 17:32:48 -0500 Subject: [PATCH] benchmark: fix http/simple.js benchmark autocannon appears to have trouble recognizing URLs that contain true or false within them. Use 0 or 1 instead to represent the same. PR-URL: https://github.com/nodejs/node/pull/17583 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen --- benchmark/fixtures/simple-http-server.js | 2 +- benchmark/http/simple.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/fixtures/simple-http-server.js b/benchmark/fixtures/simple-http-server.js index 5f56bebdafd75f..d2eda0c085c9f2 100644 --- a/benchmark/fixtures/simple-http-server.js +++ b/benchmark/fixtures/simple-http-server.js @@ -34,7 +34,7 @@ module.exports = http.createServer(function(req, res) { const arg = params[2]; const n_chunks = parseInt(params[3], 10); const resHow = params.length >= 5 ? params[4] : 'normal'; - const chunkedEnc = params.length >= 6 && params[5] === 'false' ? false : true; + const chunkedEnc = params.length >= 6 && params[5] === '0' ? false : true; var status = 200; var n, i; diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 238cd1885d3ca7..544aad49688386 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -8,14 +8,14 @@ const bench = common.createBenchmark(main, { len: [4, 1024, 102400], chunks: [1, 4], c: [50, 500], - chunkedEnc: ['true', 'false'], + chunkedEnc: [1, 0], res: ['normal', 'setHeader', 'setHeaderWH'] }); function main(conf) { process.env.PORT = PORT; var server = require('../fixtures/simple-http-server.js') - .listen(process.env.PORT || common.PORT) + .listen(PORT) .on('listening', function() { const path = `/${conf.type}/${conf.len}/${conf.chunks}/${conf.res}/${conf.chunkedEnc}`;