diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-09-07 13:20:37 -0400 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-09-07 16:05:37 -0700 |
commit | 2ffc8ac3017eb2246deb99019aacd618e5c088c3 (patch) | |
tree | 831c71e79d6cc1fef8808262350c28da2348fa49 /benchmark/http2/write.js | |
parent | 91dc50726ba61e447a2f3d7f9ef108ded95d2f64 (diff) | |
download | android-node-v8-2ffc8ac3017eb2246deb99019aacd618e5c088c3.tar.gz android-node-v8-2ffc8ac3017eb2246deb99019aacd618e5c088c3.tar.bz2 android-node-v8-2ffc8ac3017eb2246deb99019aacd618e5c088c3.zip |
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 <benjamingr@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/http2/write.js')
-rw-r--r-- | benchmark/http2/write.js | 28 |
1 files changed, 28 insertions, 0 deletions
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(); }); + }); +} |