Skip to content

diagnostics_channel: skip empty DisposableStack - #67836

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
IlyasShabi:ishabi/dc-run-stores-fast-path
Dec 2, 2026
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
IlyasShabi:ishabi/dc-run-stores-fast-path

Conversation

@IlyasShabi

Copy link
Copy Markdown
Member

This PR add a fast path when an active channel has subscribers but no bound stores. Returning early after activeChannel.publish(data) when !activeChannel._stores?.size avoids extra allocations on the subscriber hot path.

Local benchmark:

                                                                         confidence improvement accuracy (*)   (**)  (***)
tracing-channel-promise.js subscribers=1 context='omitted' n=10000000          ***     49.90 %       ±2.62% ±3.51% ±4.60%
tracing-channel-promise.js subscribers=1 context='provided' n=10000000         ***     59.97 %       ±1.83% ±2.44% ±3.18%
tracing-channel-promise.js subscribers=1 context='undefined' n=10000000        ***     49.35 %       ±1.96% ±2.62% ±3.44%
tracing-channel-sync.js subscribers=1 context='omitted' n=10000000             ***     87.70 %       ±4.65% ±6.26% ±8.27%
tracing-channel-sync.js subscribers=1 context='provided' n=10000000            ***    108.34 %       ±2.65% ±3.55% ±4.67%
tracing-channel-sync.js subscribers=1 context='undefined' n=10000000           ***     89.72 %       ±2.18% ±2.92% ±3.83%

Signed-off-by: ishabi <ilyasshabi94@gmail.com>
@nodejs-github-bot nodejs-github-bot added diagnostics_channel Issues and PRs related to the diagnostics_channel module. needs-ci PRs that need a full CI run. labels Nov 27, 2026
@IlyasShabi
IlyasShabi marked this pull request as ready for review November 27, 2026 21:28
@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.56%. Comparing base (1d069af) to head (b28a4be).
⚠️ Report is 157 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67836      +/-   ##
==========================================
+ Coverage   90.51%   90.56%   +0.05%     
==========================================
  Files         805      802       -3     
  Lines      285753   286853    +1100     
  Branches    55165    55402     +237     
==========================================
+ Hits       258652   259795    +1143     
+ Misses      17192    17149      -43     
  Partials     9909     9909              
Files with missing lines Coverage Δ
lib/diagnostics_channel.js 99.11% <100.00%> (+0.86%) ⬆️

... and 143 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@IlyasShabi IlyasShabi added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 28, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 28, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@IlyasShabi IlyasShabi added commit-queue PRs queued for automated landing through the Commit Queue. author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Nov 30, 2026
@nodejs-github-bot nodejs-github-bot added the lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. label Nov 30, 2026
Comment thread lib/diagnostics_channel.js Resolved
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. lacks-second-approval Commit Queue PRs awaiting a second collaborator approval or completion of the required wait. labels Dec 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

   ⚠  Commits were pushed since the last approving review:
   ⚠  - diagnostics_channel: skip empty DisposableStack
   ⚠  - use else block
   ✖  This PR needs to wait 56 more hours to land (or 0 minutes if there is one more approval)
   ✖  GitHub CI is still running
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - use else block

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
�[36m⠋�[39m Loading data for nodejs/node/pull/67836
�[36m⠋�[39m Loading data for nodejs/node/pull/67836
�[36m⠋�[39m Getting collaborator contacts from README of nodejs/node
�[36m⠋�[39m Getting PR from nodejs/node/pull/67836
�[36m⠋�[39m Getting reviews from nodejs/node/pull/67836
�[36m⠋�[39m Getting comments from nodejs/node/pull/67836
�[36m⠋�[39m Getting commits from nodejs/node/pull/67836
✔  Done loading data for nodejs/node/pull/67836
----------------------------------- PR info ------------------------------------
Title      diagnostics_channel: skip empty DisposableStack (#67836)
Author     Ilyas Shabi <ilyasshabi94@gmail.com> (@IlyasShabi)
Branch     IlyasShabi:ishabi/dc-run-stores-fast-path -> nodejs:main
Labels     author ready, needs-ci, commit-queue, diagnostics_channel, lacks-second-approval
Commits    2
 - diagnostics_channel: skip empty DisposableStack
 - use else block
Committers 1
 - ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67836
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/67836
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - diagnostics_channel: skip empty DisposableStack
   ⚠  - use else block
   ℹ  This PR was created on Fri, 27 Nov 2026 21:22:21 GMT
   ✔  Approvals: 1
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/67836#pullrequestreview-6093535768
   ✖  This PR needs to wait 56 more hours to land (or 0 minutes if there is one more approval)
   ✖  GitHub CI is still running
   ℹ  Last Full PR CI on 2026-11-30T12:02:40Z: https://ci.nodejs.org/job/node-test-pull-request/79611/
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - use else block
�[36m⠙�[39m Querying data for job/node-test-pull-request/79611/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79611/
�[36m⠙�[39m Querying API for job/node-test-pull-request/79611/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu

View workflow run

@BridgeAR BridgeAR added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Dec 2, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@gurgunday gurgunday 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.

Lgtm

@gurgunday gurgunday added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Dec 2, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Dec 2, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@IlyasShabi IlyasShabi added the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 2, 2026
@IlyasShabi IlyasShabi added the commit-queue-squash PRs the Commit Queue should land as one squashed commit. label Dec 2, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 9873287 into nodejs:main Dec 2, 2026
76 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 9873287

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. diagnostics_channel Issues and PRs related to the diagnostics_channel module. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants