Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-08-12 17:49:31 +0300
committerMyles Borins <mylesborins@google.com>2017-09-12 04:17:00 +0300
commit1b57c375aa7206e6c0f9c938255e464247ec237e (patch)
treed79f8014ba620a88ff624cacd9d7dafa1d217d56 /benchmark
parent56bb199ef0eca5f1264956853a21265fb451f0e4 (diff)
http2: minor refactor of passing headers to JS
- Make `ExternalString::New` return a `MaybeLocal`. Failing is left up to the caller. - Allow creating internalized strings for short header names to reduce memory consumption and increase performance. - Use persistent storage for statically allocated header names. PR-URL: https://github.com/nodejs/node/pull/14808 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/http2/headers.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/benchmark/http2/headers.js b/benchmark/http2/headers.js
index 09449d1e92f..078e7a356a0 100644
--- a/benchmark/http2/headers.js
+++ b/benchmark/http2/headers.js
@@ -5,7 +5,7 @@ const PORT = common.PORT;
var bench = common.createBenchmark(main, {
n: [1e3],
- nheaders: [100, 1000],
+ nheaders: [0, 10, 100, 1000],
}, { flags: ['--expose-http2', '--no-warnings'] });
function main(conf) {
@@ -14,7 +14,16 @@ function main(conf) {
const http2 = require('http2');
const server = http2.createServer();
- const headersObject = { ':path': '/' };
+ const headersObject = {
+ ':path': '/',
+ ':scheme': 'http',
+ 'accept-encoding': 'gzip, deflate',
+ 'accept-language': 'en',
+ 'content-type': 'text/plain',
+ 'referer': 'https://example.org/',
+ 'user-agent': 'SuperBenchmarker 3000'
+ };
+
for (var i = 0; i < nheaders; i++) {
headersObject[`foo${i}`] = `some header value ${i}`;
}