Repository navigation
tools: add lint rule for unread benchmark n - #66807
Open
GroophyLifefor wants to merge 2 commits into
Open
GroophyLifefor wants to merge 2 commits into
GroophyLifefor wants to merge 2 commits into
Conversation
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
Collaborator
|
Review requested:
|
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. |
aduh95
approved these changes
Oct 17, 2026
Signed-off-by: Murat Kirazkaya <groophylifefor@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 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 🚀 New features to boost your workflow:
|
Collaborator
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
node-core/benchmark-n-configlint rule: if a benchmark declaresnin its configs,main()must read it.This would have caught #59872, which renamed
numtonbut leftmain({ num: n }), sonwasundefined(fixed in #62084).It also found
async_hooks/async-resource-vs-destroy.js, wheren: [1e6]was never read; removed.Refs: nodejs/performance#187