Skip to content
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

feat(rspack): improve plugin createNodes performance #29876

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Feb 4, 2025

Current Behavior

Currently, calculating nodes via the @nx/rspack/plugin takes a long time because the hash generation attempts to hash every source file.
This is problematic because the targets that are inferred do not rely on the source files themselves and rather just the config file.

It also means the time taken to infer the targets grows as the project grows.

Expected Behavior

Calculate the hash based off the config file and the installed dependencies, allowing it to scale as the project grows and allowing it to be invalidated if dependencies change.

Tested Results

Application with 90k files
Previous: 2mins
New: 1.18s

@Coly010 Coly010 requested a review from a team as a code owner February 4, 2025 16:52
@Coly010 Coly010 self-assigned this Feb 4, 2025
@Coly010 Coly010 requested a review from mandarini February 4, 2025 16:52
Copy link

vercel bot commented Feb 4, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 9:14pm

Copy link

nx-cloud bot commented Feb 4, 2025

View your CI Pipeline Execution ↗ for commit c10edf7.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 1m 48s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 14s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base= --he... ✅ Succeeded 6s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 34s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-04 21:21:01 UTC

@Coly010 Coly010 requested a review from leosvelperez February 4, 2025 16:53
@Coly010 Coly010 marked this pull request as draft February 4, 2025 16:55
@Coly010 Coly010 force-pushed the rspack/create-nodes-perf branch from 89aaa41 to 67ae768 Compare February 4, 2025 17:02
@Coly010 Coly010 marked this pull request as ready for review February 4, 2025 17:09
@Coly010 Coly010 force-pushed the rspack/create-nodes-perf branch from 67ae768 to 9eb2067 Compare February 4, 2025 20:20
@Coly010 Coly010 force-pushed the rspack/create-nodes-perf branch from 9eb2067 to c10edf7 Compare February 4, 2025 21:11
@Coly010 Coly010 merged commit 18c555a into master Feb 4, 2025
12 checks passed
@Coly010 Coly010 deleted the rspack/create-nodes-perf branch February 4, 2025 21:30
FrozenPandaz pushed a commit that referenced this pull request Feb 6, 2025
## Current Behavior
Currently, calculating nodes via the `@nx/rspack/plugin` takes a long
time because the hash generation attempts to hash every source file.
This is problematic because the targets that are inferred do not rely on
the source files themselves and rather just the config file.

It also means the time taken to infer the targets grows as the project
grows.

## Expected Behavior
Calculate the hash based off the config file and the installed
dependencies, allowing it to scale as the project grows and allowing it
to be invalidated if dependencies change.

## Tested Results
Application with 90k files
Previous:  2mins
New: 1.18s

(cherry picked from commit 18c555a)
FrozenPandaz pushed a commit that referenced this pull request Feb 6, 2025
## Current Behavior
Currently, calculating nodes via the `@nx/rspack/plugin` takes a long
time because the hash generation attempts to hash every source file.
This is problematic because the targets that are inferred do not rely on
the source files themselves and rather just the config file.

It also means the time taken to infer the targets grows as the project
grows.

## Expected Behavior
Calculate the hash based off the config file and the installed
dependencies, allowing it to scale as the project grows and allowing it
to be invalidated if dependencies change.

## Tested Results
Application with 90k files
Previous:  2mins
New: 1.18s

(cherry picked from commit 18c555a)
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 Feb 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants