Skip to content

Commit 9ae513a

Browse files
joyeecheungMylesBorins
authored andcommitted
benchmark: shorten config name in http benchmark
Shorten the config name in check_invalid_header_char so it would not result in long lines that make the benchmark result hard to read. PR-URL: #18452 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 8c9b41a commit 9ae513a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

benchmark/http/check_invalid_header_char.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
const common = require('../common.js');
44
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
55

6+
// Put it here so the benchmark result lines will not be super long.
7+
const LONG_AND_INVALID = 'Here is a value that is really a folded header ' +
8+
'value\r\n this should be supported, but it is not currently';
9+
610
const bench = common.createBenchmark(main, {
711
key: [
812
// Valid
@@ -21,8 +25,7 @@ const bench = common.createBenchmark(main, {
2125
'en-US',
2226

2327
// Invalid
24-
'Here is a value that is really a folded header value\r\n this should be \
25-
supported, but it is not currently',
28+
'LONG_AND_INVALID',
2629
'中文呢', // unicode
2730
'foo\nbar',
2831
'\x7F'
@@ -31,6 +34,9 @@ const bench = common.createBenchmark(main, {
3134
});
3235

3336
function main({ n, key }) {
37+
if (key === 'LONG_AND_INVALID') {
38+
key = LONG_AND_INVALID;
39+
}
3440
bench.start();
3541
for (var i = 0; i < n; i++) {
3642
_checkInvalidHeaderChar(key);

0 commit comments

Comments
 (0)