FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test_runner: disable highWatermark on TestsStream by cjihrig · Pull Request #52287 · nodejs/node · GitHub

/ node Public

test_runner: disable highWatermark on TestsStream - #52287

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
cjihrig:hwm
Apr 2, 2024
Merged

test_runner: disable highWatermark on TestsStream#52287
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
cjihrig:hwm

Conversation

cjihrig commented Mar 31, 2024

Copy link
Copy Markdown
Contributor

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.

To test this, I ran the following code:

'use strict';
const { describe, it } = require('node:test');

for (let i = 0; i < 100; ++i) {
  describe(`suite ${i + 1}`, () => {
    for (let j = 0; j < 100; ++j) {
      it(`test ${i + 1}-${j + 1}`, () => {});
    }
  });
}

Running the command time ./node test.js on my machine before and after this change yielded:

Before this change:

  • With --test: 2.12 seconds
  • Without --test: 1.43 seconds

After this change:

  • With --test: 0.94 seconds
  • Without --test: 0.42 seconds

For reference, mocha (time ./node ./node_modules/.bin/mocha test.js, with the node:test import removed) yielded 0.95 seconds.

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.

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Mar 31, 2024

MoLow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

amazing

MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2024

Copy link
Copy Markdown
Collaborator

cjihrig added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Mar 31, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 2, 2024
nodejs-github-bot merged commit 2c024cd into nodejs:main Apr 2, 2024

Copy link
Copy Markdown
Collaborator

Landed in 2c024cd

cjihrig deleted the hwm branch April 2, 2024 03:38
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
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: #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>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
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: #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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL