Skip to content

Commit

Permalink
benchmark: fix http/simple.js benchmark
Browse files Browse the repository at this point in the history
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: #17583
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
apapirovski committed Dec 11, 2017
1 parent f3aaaa5 commit 4df7c19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmark/fixtures/simple-http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/http/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 4df7c19

Please sign in to comment.