mirror of https://github.com/nodejs/node.git
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
ef2861961c
commit
d3841ec872
|
@ -3,6 +3,10 @@
|
|||
const common = require('../common.js');
|
||||
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
|
||||
|
||||
// Put it here so the benchmark result lines will not be super long.
|
||||
const LONG_AND_INVALID = 'Here is a value that is really a folded header ' +
|
||||
'value\r\n this should be supported, but it is not currently';
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
key: [
|
||||
// Valid
|
||||
|
@ -21,8 +25,7 @@ const bench = common.createBenchmark(main, {
|
|||
'en-US',
|
||||
|
||||
// Invalid
|
||||
'Here is a value that is really a folded header value\r\n this should be \
|
||||
supported, but it is not currently',
|
||||
'LONG_AND_INVALID',
|
||||
'中文呢', // unicode
|
||||
'foo\nbar',
|
||||
'\x7F'
|
||||
|
@ -31,6 +34,9 @@ const bench = common.createBenchmark(main, {
|
|||
});
|
||||
|
||||
function main({ n, key }) {
|
||||
if (key === 'LONG_AND_INVALID') {
|
||||
key = LONG_AND_INVALID;
|
||||
}
|
||||
bench.start();
|
||||
for (var i = 0; i < n; i++) {
|
||||
_checkInvalidHeaderChar(key);
|
||||
|
|
Loading…
Reference in New Issue