diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index 304b65cd39aa87..78f7aa736f033a 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -6,10 +6,13 @@ const Writable = require('stream').Writable; const bench = common.createBenchmark(main, { n: [2e6], sync: ['yes', 'no'], - writev: ['yes', 'no'] + writev: ['yes', 'no'], + callback: ['yes', 'no'] }); -function main({ n, sync, writev }) { +function nop() {} + +function main({ n, sync, writev, callback }) { const b = Buffer.allocUnsafe(1024); const s = new Writable(); sync = sync === 'yes'; @@ -30,11 +33,13 @@ function main({ n, sync, writev }) { }; } + const cb = callback === 'yes' ? nop : null; + bench.start(); let k = 0; function run() { - while (k++ < n && s.write(b)); + while (k++ < n && s.write(b, cb)); if (k >= n) bench.end(n); }