From 2ffc8ac3017eb2246deb99019aacd618e5c088c3 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Thu, 7 Sep 2017 13:20:37 -0400 Subject: http2: set decodeStrings to false, test Set writableStream decodeStrings to false to let the native layer handle converting strings to buffer. PR-URL: https://github.com/nodejs/node/pull/15140 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Claudio Rodriguez Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- benchmark/http2/write.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 benchmark/http2/write.js (limited to 'benchmark/http2/write.js') diff --git a/benchmark/http2/write.js b/benchmark/http2/write.js new file mode 100644 index 0000000000..df76794468 --- /dev/null +++ b/benchmark/http2/write.js @@ -0,0 +1,28 @@ +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; + +var bench = common.createBenchmark(main, { + streams: [100, 200, 1000], + length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], +}, { flags: ['--expose-http2', '--no-warnings'] }); + +function main(conf) { + const m = +conf.streams; + const l = +conf.length; + const http2 = require('http2'); + const server = http2.createServer(); + server.on('stream', (stream) => { + stream.respond(); + stream.write('ΓΌ'.repeat(l)); + stream.end(); + }); + server.listen(PORT, () => { + bench.http({ + path: '/', + requests: 10000, + maxConcurrentStreams: m, + }, () => { server.close(); }); + }); +} -- cgit v1.2.3