Skip to content

lib: use indexed appends for dependent signals - #67299

Open
rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:perf-abortsignal-fanout-append
Open

rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:perf-abortsignal-fanout-append

Conversation

@rozzilla

@rozzilla rozzilla commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Use indexed writes instead of primordial push calls when collecting dependent signals to abort.
Abort-throughput benchmarks on Apple M2/macOS 15.7.4, using rebuilt Node v28.0.0-pre binaries against 47438d9. Fixtures were created outside timing, with 30 samples per binary:

Dependents per source Aborts per sample Candidate vs baseline
16 2,000 +18.55% ±11.94%
64 1,000 +28.07% ±10.37%

Validation:

  • make -j8: passed
  • make lint-js: passed
  • python3 tools/test.py parallel/test-abortsignal-any.mjs parallel/test-abortsignal-drop-settled-signals.mjs: passed
  • make -j4 test: not run

Avoid a primordial push call for each dependent signal.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 6, 2026
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.68%. Comparing base (47438d9) to head (afd1bf6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67299      +/-   ##
==========================================
- Coverage   93.00%   90.68%   -2.33%     
==========================================
  Files         428      797     +369     
  Lines      195814   279609   +83795     
  Branches    30287    53780   +23493     
==========================================
+ Hits       182117   253557   +71440     
- Misses      13371    16347    +2976     
- Partials      326     9705    +9379     
Files with missing lines Coverage Δ
lib/internal/abort_controller.js 95.41% <100.00%> (-0.01%) ⬇️

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants