diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-30 18:41:25 +0800 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-01 12:02:54 +0100 |
commit | d3841ec8727cbc69d520fccbd3b95c90a4a6661b (patch) | |
tree | 86091f098fc2ab2ba5397f85951ed9113a136844 /benchmark/http | |
parent | ef2861961c3d9e9ed6972e1e84d969683b25cf95 (diff) | |
download | android-node-v8-d3841ec8727cbc69d520fccbd3b95c90a4a6661b.tar.gz android-node-v8-d3841ec8727cbc69d520fccbd3b95c90a4a6661b.tar.bz2 android-node-v8-d3841ec8727cbc69d520fccbd3b95c90a4a6661b.zip |
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>
Diffstat (limited to 'benchmark/http')
-rw-r--r-- | benchmark/http/check_invalid_header_char.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/benchmark/http/check_invalid_header_char.js b/benchmark/http/check_invalid_header_char.js index b9933d690e..399e71b2df 100644 --- a/benchmark/http/check_invalid_header_char.js +++ b/benchmark/http/check_invalid_header_char.js @@ -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); |