mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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>
This commit is contained in:
1 parent
658cae0684
commit
003fb53c9a
8 files changed
+25
-17
No files matched your search
@@ -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';
|
||||
|
||||
|
||||
Reference in new issue
Block a user