Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9ae513a

Browse filesBrowse 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 <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 8c9b41a commit 9ae513a
Copy full SHA for 9ae513a

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Open diff view settings
Collapse file

‎benchmark/http/check_invalid_header_char.js‎

Copy file name to clipboardExpand all lines: benchmark/http/check_invalid_header_char.js
+8-2Lines changed: 8 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.