test_runner: disable highWatermark on TestsStream

The default highWatermark of 16 on the TestsStream class can
have a substantial impact on reporting performance. This commit
sets the TestsStream highWatermark to a very large value and
lets the destination streams (which are more likely to have
meaningful highWatermarks) handle backpressure.

PR-URL: https://github.com/nodejs/node/pull/52287
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit is contained in:
Colin Ihrig authored and GitHub committed 2024-04-02 03:37:30 +00:00
1 parent 9efc84a2cb
commit 2c024cd24d
1 file changed
+6 -1
+6 -1
View File
@@ -2,6 +2,7 @@
const {
ArrayPrototypePush,
ArrayPrototypeShift,
NumberMAX_SAFE_INTEGER,
Symbol,
} = primordials;
const Readable = require('internal/streams/readable');
@@ -12,7 +13,11 @@ class TestsStream extends Readable {
#canPush;
constructor() {
super({ __proto__: null, objectMode: true });
super({
__proto__: null,
objectMode: true,
highWaterMark: NumberMAX_SAFE_INTEGER,
});
this.#buffer = [];
this.#canPush = true;
}