diff options
author | Richard Lau <riclau@uk.ibm.com> | 2020-09-10 02:48:00 +0300 |
---|---|---|
committer | Richard Lau <riclau@uk.ibm.com> | 2020-09-10 02:49:34 +0300 |
commit | 0f94c6b4e4dd4b3f0d30d40b2063db6a0ccf0e0d (patch) | |
tree | 259481328c227b1a925f0c8ef5efb1d3b10966ea /benchmark | |
parent | 2d52bdf5c6566a40af359fb3be7e449d855fabe9 (diff) |
Revert "stream: simpler and faster Readable async iterator"
This reverts commit 4bb40078da9ff51372459ff187b74866d73c3fb2.
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/streams/readable-async-iterator.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/benchmark/streams/readable-async-iterator.js b/benchmark/streams/readable-async-iterator.js deleted file mode 100644 index dbe335ab98b..00000000000 --- a/benchmark/streams/readable-async-iterator.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -const common = require('../common'); -const Readable = require('stream').Readable; - -const bench = common.createBenchmark(main, { - n: [1e5], - sync: ['yes', 'no'], -}); - -async function main({ n, sync }) { - sync = sync === 'yes'; - - const s = new Readable({ - objectMode: true, - read() { - if (sync) { - this.push(1); - } else { - process.nextTick(() => { - this.push(1); - }); - } - } - }); - - bench.start(); - - let x = 0; - for await (const chunk of s) { - x += chunk; - if (x > n) { - break; - } - } - - bench.end(n); -} |