Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 22, 2025

Conversation

meeroslav
Copy link
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
Copy link

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

Copy link

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
Copy link

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