benchmark: add trailing commas in benchmark/http2

PR-URL: https://github.com/nodejs/node/pull/46552
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Antoine du Hamel 2023-02-10 00:15:52 +01:00 committed by GitHub
parent 5092346439
commit 71646e2eca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 12 deletions

View file

@ -11,7 +11,6 @@ overrides:
- files: - files:
- crypto/*.js - crypto/*.js
- http/*.js - http/*.js
- http2/*.js
- path/*.js - path/*.js
- url/*.js - url/*.js
rules: rules:

View file

@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
streams: [1, 10, 20, 40, 100, 200], streams: [1, 10, 20, 40, 100, 200],
clients: [2], clients: [2],
benchmarker: ['test-double-http2'], benchmarker: ['test-double-http2'],
duration: 5 duration: 5,
}, { flags: ['--no-warnings'] }); }, { flags: ['--no-warnings'] });
function main({ requests, streams, clients, duration }) { function main({ requests, streams, clients, duration }) {
@ -32,7 +32,7 @@ function main({ requests, streams, clients, duration }) {
maxConcurrentStreams: streams, maxConcurrentStreams: streams,
clients, clients,
threads: clients, threads: clients,
duration duration,
}, () => { server.close(); }); }, () => { server.close(); });
}); });
} }

View file

@ -4,13 +4,13 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, { const bench = common.createBenchmark(main, {
n: [1e3], n: [1e3],
nheaders: [0, 10, 100, 1000] nheaders: [0, 10, 100, 1000],
}, { flags: ['--no-warnings'] }); }, { flags: ['--no-warnings'] });
function main({ n, nheaders }) { function main({ n, nheaders }) {
const http2 = require('http2'); const http2 = require('http2');
const server = http2.createServer({ const server = http2.createServer({
maxHeaderListPairs: 20000 maxHeaderListPairs: 20000,
}); });
const headersObject = { const headersObject = {
@ -20,7 +20,7 @@ function main({ n, nheaders }) {
'accept-language': 'en', 'accept-language': 'en',
'content-type': 'text/plain', 'content-type': 'text/plain',
'referer': 'https://example.org/', 'referer': 'https://example.org/',
'user-agent': 'SuperBenchmarker 3000' 'user-agent': 'SuperBenchmarker 3000',
}; };
for (let i = 0; i < nheaders; i++) { for (let i = 0; i < nheaders; i++) {
@ -33,7 +33,7 @@ function main({ n, nheaders }) {
}); });
server.listen(0, () => { server.listen(0, () => {
const client = http2.connect(`http://localhost:${server.address().port}/`, { const client = http2.connect(`http://localhost:${server.address().port}/`, {
maxHeaderListPairs: 20000 maxHeaderListPairs: 20000,
}); });
function doRequest(remaining) { function doRequest(remaining) {

View file

@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
streams: [1, 10, 20, 40, 100, 200], streams: [1, 10, 20, 40, 100, 200],
clients: [2], clients: [2],
benchmarker: ['test-double-http2'], benchmarker: ['test-double-http2'],
duration: 5 duration: 5,
}, { flags: ['--no-warnings'] }); }, { flags: ['--no-warnings'] });
function main({ requests, streams, clients, duration }) { function main({ requests, streams, clients, duration }) {
@ -33,7 +33,7 @@ function main({ requests, streams, clients, duration }) {
maxConcurrentStreams: streams, maxConcurrentStreams: streams,
clients, clients,
duration, duration,
threads: clients threads: clients,
}, () => server.close()); }, () => server.close());
}); });

View file

@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
streams: [1, 10, 20, 40, 100, 200], streams: [1, 10, 20, 40, 100, 200],
clients: [2], clients: [2],
benchmarker: ['test-double-http2'], benchmarker: ['test-double-http2'],
duration: 5 duration: 5,
}, { flags: ['--no-warnings'] }); }, { flags: ['--no-warnings'] });
function main({ requests, streams, clients, duration }) { function main({ requests, streams, clients, duration }) {
@ -30,7 +30,7 @@ function main({ requests, streams, clients, duration }) {
maxConcurrentStreams: streams, maxConcurrentStreams: streams,
clients, clients,
duration, duration,
threads: clients threads: clients,
}, () => { server.close(); }); }, () => { server.close(); });
}); });
} }

View file

@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024],
size: [100000], size: [100000],
benchmarker: ['test-double-http2'], benchmarker: ['test-double-http2'],
duration: 5 duration: 5,
}, { flags: ['--no-warnings'] }); }, { flags: ['--no-warnings'] });
function main({ streams, length, size, duration }) { function main({ streams, length, size, duration }) {