diff options
author | Robert Nagy <ronagy@icloud.com> | 2020-04-16 22:49:41 +0300 |
---|---|---|
committer | Robert Nagy <ronagy@icloud.com> | 2020-04-25 19:45:50 +0300 |
commit | 003fb53c9a38520e84bd18beb7719f1a47af8c43 (patch) | |
tree | 29a4cf0e9d783305481bb6ab95ad7a39a20a09bf /benchmark | |
parent | 658cae06846877a16308b100931c7c8d6f1ed27c (diff) |
stream: avoid drain for sync streams
Previously a sync writable receiving chunks
larger than highwatermark would unecessarily
ping pong needDrain.
PR-URL: https://github.com/nodejs/node/pull/32887
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/streams/writable-manywrites.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index e4ae9ab91e5..025a5017ee6 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -7,11 +7,12 @@ const bench = common.createBenchmark(main, { n: [2e6], sync: ['yes', 'no'], writev: ['yes', 'no'], - callback: ['yes', 'no'] + callback: ['yes', 'no'], + len: [1024, 32 * 1024] }); -function main({ n, sync, writev, callback }) { - const b = Buffer.allocUnsafe(1024); +function main({ n, sync, writev, callback, len }) { + const b = Buffer.allocUnsafe(len); const s = new Writable(); sync = sync === 'yes'; |