Skip to content

Commit 3c918c7

Browse files
apapirovskiMylesBorins
authored andcommitted
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: #17583 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 062e23b commit 3c918c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

benchmark/fixtures/simple-http-server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = http.createServer(function(req, res) {
3434
const arg = params[2];
3535
const n_chunks = parseInt(params[3], 10);
3636
const resHow = params.length >= 5 ? params[4] : 'normal';
37-
const chunkedEnc = params.length >= 6 && params[5] === 'false' ? false : true;
37+
const chunkedEnc = params.length >= 6 && params[5] === '0' ? false : true;
3838
var status = 200;
3939

4040
var n, i;

benchmark/http/simple.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ const bench = common.createBenchmark(main, {
88
len: [4, 1024, 102400],
99
chunks: [1, 4],
1010
c: [50, 500],
11-
chunkedEnc: ['true', 'false'],
11+
chunkedEnc: [1, 0],
1212
res: ['normal', 'setHeader', 'setHeaderWH']
1313
});
1414

1515
function main(conf) {
1616
process.env.PORT = PORT;
1717
var server = require('../fixtures/simple-http-server.js')
18-
.listen(process.env.PORT || common.PORT)
18+
.listen(PORT)
1919
.on('listening', function() {
2020
const path =
2121
`/${conf.type}/${conf.len}/${conf.chunks}/${conf.res}/${conf.chunkedEnc}`;

0 commit comments

Comments
 (0)