From 2c024cd24d0b3ab34df6bf9db1bc145db0529769 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Mon, 1 Apr 2024 23:37:30 -0400 Subject: [PATCH] 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 Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Chemi Atlow --- lib/internal/test_runner/tests_stream.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/internal/test_runner/tests_stream.js b/lib/internal/test_runner/tests_stream.js index 1b86aeeaff2800..83b2a903218df1 100644 --- a/lib/internal/test_runner/tests_stream.js +++ b/lib/internal/test_runner/tests_stream.js @@ -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; }