Skip to content

Conversation

@gurgunday
Copy link
Member

branch:

./node benchmark/run.js --filter handled-rejections process

process/handled-rejections.js
process/handled-rejections.js n=10000: 237,537.91758393912
process/handled-rejections.js n=50000: 306,685.9060958424
process/handled-rejections.js n=100000: 324,124.4183992467

main:

./node benchmark/run.js --filter handled-rejections process

process/handled-rejections.js
process/handled-rejections.js n=10000: 148,219.51309889948
process/handled-rejections.js n=50000: 42,906.982381963964
process/handled-rejections.js n=100000: 23,234.612142965194

Using a regular Array for a queue that only shifts elements is inefficient due to O(N) time complexity per shift operation. FixedQueue provides O(1) dequeue performance

In the benchmark, to really highlight the effect, I used the --unhandled-rejections=warn flag since it uses the queue even more

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Nov 25, 2025
@gurgunday gurgunday added the performance Issues and PRs related to the performance of Node.js. label Nov 25, 2025
Copy link
Member

@juanarbol juanarbol left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.54%. Comparing base (4451309) to head (3b5e9c0).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60854      +/-   ##
==========================================
- Coverage   88.56%   88.54%   -0.03%     
==========================================
  Files         703      703              
  Lines      208259   208259              
  Branches    40187    40164      -23     
==========================================
- Hits       184454   184411      -43     
- Misses      15812    15836      +24     
- Partials     7993     8012      +19     
Files with missing lines Coverage Δ
lib/internal/process/promises.js 100.00% <100.00%> (ø)

... and 28 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.

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 28, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 28, 2025
@nodejs-github-bot
Copy link
Collaborator

@gurgunday gurgunday added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 29, 2025
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 pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js. process Issues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants