Skip to content

perf(linter/eslint/no-useless-call): fast-path static callees#24077

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-useless-call-fast-path
Jul 2, 2026
Merged

perf(linter/eslint/no-useless-call): fast-path static callees#24077
graphite-app[bot] merged 1 commit into
mainfrom
codex/no-useless-call-fast-path

Conversation

@camc314

@camc314 camc314 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Split the eslint/no-useless-call fast path out from perf(linter): speed up hot rules on large codebases #23829 for easier review and bisectability.
  • Add a direct static-member callee classifier for foo.call(...) / foo.apply(...), so common non-.call / non-.apply static calls return before the generic member-expression fallback.
  • Keep the fallback for parenthesized, chained, computed, and optional-chain cases, with parenthesized regression coverage.

Credit to Yagiz Nizipli for the original work in #23829.

Co-authored-by: Yagiz Nizipli yagiz@nizipli.com

Copilot AI review requested due to automatic review settings July 2, 2026 15:28
@github-actions github-actions Bot added the A-linter Area - Linter label Jul 2, 2026
@camc314 camc314 changed the title perf(linter/eslint): speed up no-useless-call perf(linter/eslint/no-useless-call): fast-path static callees Jul 2, 2026
@camc314 camc314 self-assigned this Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors and optimizes the eslint/no-useless-call lint rule’s hot path by adding a direct classifier for common static-member callees (foo.call(...) / foo.apply(...)) while preserving the existing fallback for more complex callee shapes (parenthesized, chained/optional, computed).

Changes:

  • Introduce classify_callee + CallOrApply to quickly recognize .call/.apply on Expression::StaticMemberExpression before the more general member-expression handling.
  • Consolidate argument-shape validation into CallOrApply::has_valid_arguments and simplify the main run flow.
  • Add regression coverage for parenthesized callee forms like (foo.call)(...) / (obj.foo.apply)(...) and update the corresponding insta snapshot.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc_linter/src/rules/eslint/no_useless_call.rs Adds a fast callee classifier for .call/.apply and refactors argument gating to reduce work on non-matching calls.
crates/oxc_linter/src/snapshots/eslint_no_useless_call.snap Updates snapshots to reflect newly-covered parenthesized .call / .apply failure cases.

@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 66 skipped benchmarks1


Comparing codex/no-useless-call-fast-path (6e7b8ff) with main (e6cee89)

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314

camc314 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 6e7b8ffdbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jul 2, 2026

camc314 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

## Summary
- Split the `eslint/no-useless-call` fast path out from #23829 for easier review and bisectability.
- Add a direct static-member callee classifier for `foo.call(...)` / `foo.apply(...)`, so common non-`.call` / non-`.apply` static calls return before the generic member-expression fallback.
- Keep the fallback for parenthesized, chained, computed, and optional-chain cases, with parenthesized regression coverage.

Credit to Yagiz Nizipli for the original work in #23829.

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
@graphite-app graphite-app Bot force-pushed the codex/no-useless-call-fast-path branch from 6e7b8ff to fdbd34d Compare July 2, 2026 15:48
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 2, 2026
@graphite-app graphite-app Bot merged commit fdbd34d into main Jul 2, 2026
53 checks passed
@graphite-app graphite-app Bot deleted the codex/no-useless-call-fast-path branch July 2, 2026 15:55
camc314 added a commit that referenced this pull request Jul 3, 2026
## Summary
- Split the `eslint/no-useless-call` fast path out from #23829 for easier review and bisectability.
- Add a direct static-member callee classifier for `foo.call(...)` / `foo.apply(...)`, so common non-`.call` / non-`.apply` static calls return before the generic member-expression fallback.
- Keep the fallback for parenthesized, chained, computed, and optional-chain cases, with parenthesized regression coverage.

Credit to Yagiz Nizipli for the original work in #23829.

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
camc314 added a commit that referenced this pull request Jul 3, 2026
## Summary
- Split the `eslint/no-useless-call` fast path out from #23829 for easier review and bisectability.
- Add a direct static-member callee classifier for `foo.call(...)` / `foo.apply(...)`, so common non-`.call` / non-`.apply` static calls return before the generic member-expression fallback.
- Keep the fallback for parenthesized, chained, computed, and optional-chain cases, with parenthesized regression coverage.

Credit to Yagiz Nizipli for the original work in #23829.

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants