Skip to content

tools: add lint rule for unread benchmark n - #66807

Open
GroophyLifefor wants to merge 2 commits into
nodejs:mainfrom
GroophyLifefor:tools-benchmark-n-config
Open

GroophyLifefor wants to merge 2 commits into
nodejs:mainfrom
GroophyLifefor:tools-benchmark-n-config

Conversation

@GroophyLifefor

Copy link
Copy Markdown

Adds a node-core/benchmark-n-config lint rule: if a benchmark declares n in its configs, main() must read it.

This would have caught #59872, which renamed num to n but left main({ num: n }), so n was undefined (fixed in #62084).

It also found async_hooks/async-resource-vs-destroy.js, where n: [1e6] was never read; removed.

Refs: nodejs/performance#187

If a benchmark declares `n` in its configs, main() must read it.
nodejs#59872 renamed a config key from `num` to `n` but left
`{ num: n }` in main(), so `n` resolved to undefined and the
benchmark silently reported near-zero results until nodejs#62084 fixed
it.

The rule also found `async_hooks/async-resource-vs-destroy.js`,
which has declared `n: [1e6]` since it was added but never read
it. Remove the unused key.

Refs: nodejs#59872
Refs: nodejs#62084
Signed-off-by: Murat Kirazkaya <groophylifefor@gmail.com>
Assisted-by: Claude Code
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance
  • @nodejs/tsc

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. labels Oct 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Comment thread doc/contributing/writing-and-running-benchmarks.md Outdated
Signed-off-by: Murat Kirazkaya <groophylifefor@gmail.com>

@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

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.51%. Comparing base (1c90519) to head (35b96a5).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66807      +/-   ##
==========================================
+ Coverage   90.49%   90.51%   +0.01%     
==========================================
  Files         797      797              
  Lines      277598   277785     +187     
  Branches    53336    53361      +25     
==========================================
+ Hits       251220   251442     +222     
+ Misses      16790    16747      -43     
- Partials     9588     9596       +8     

see 52 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.

@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 17, 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 Oct 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants