Skip to content

fix(linter): speed up inferred plugin node processing#31281

Merged
meeroslav merged 6 commits intomasterfrom
fix/speed-up-linter-plugin
May 22, 2025
Merged

fix(linter): speed up inferred plugin node processing#31281
meeroslav merged 6 commits intomasterfrom
fix/speed-up-linter-plugin

Conversation

@meeroslav
Copy link
Copy Markdown
Contributor

@meeroslav meeroslav commented May 20, 2025

This PR improves the createNodes function of eslint's inferred plugin by making two pragmatic choices:

  • reusing the ESLint between config file's runs instead of recreating the new one every time
  • skipping ignored files checks for projects that already have eslint config file

Results of benchmarks on customer's repo:

Without ESLint plugin

  • create-project-graph-async - avg. 11739.1326225 -> 11 seconds

With current ESLint plugin

  • create-project-graph-async - avg. 98005.0965135 -> 98 seconds

With modified ESLint plugin

  • create-project-graph-async - avg. 13225.073817 -> 13 seconds
    • (@nx/eslint/plugin:createNodes - 2206.96497, 16.69%)

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@meeroslav meeroslav self-assigned this May 20, 2025
@meeroslav meeroslav requested a review from a team as a code owner May 20, 2025 10:43
@meeroslav meeroslav requested a review from leosvelperez May 20, 2025 10:43
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview May 22, 2025 11:51am

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 20, 2025

View your CI Pipeline Execution ↗ for commit 5995489.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 33m 41s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 17s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 2s View ↗
nx documentation ✅ Succeeded 1m 5s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-22 12:21:38 UTC

@meeroslav meeroslav added the scope: linter Issues related to Eslint support in Nx label May 20, 2025
@meeroslav meeroslav removed the request for review from leosvelperez May 21, 2025 12:45
@meeroslav meeroslav force-pushed the fix/speed-up-linter-plugin branch from e3e3d24 to 4d55ff0 Compare May 21, 2025 15:00
@meeroslav meeroslav merged commit d78782d into master May 22, 2025
6 checks passed
@meeroslav meeroslav deleted the fix/speed-up-linter-plugin branch May 22, 2025 13:59
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scope: linter Issues related to Eslint support in Nx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants