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

fix: detect module graph change right before build_chunk_graph #9453

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

JSerFeng
Copy link
Contributor

@JSerFeng JSerFeng commented Feb 25, 2025

Summary

Background

We have a way to skip re-building chunk graph, that is, when module graph has no change, no incoming outgoing changes, we can skip creating chunks for current compilation.

We detect module graph change in make phase before, which is not exactly accurate.

Issue

Many optimizations are applied after make phase, for example, innerGraph, sideEffects and usedExports, they can change module graph as well. To solve this, we did a lot of hack to detect change according to many aspects, even dependency.ids, as it can affect how sideEffects optimized.

Current solution

Now I move this detection later right before build_chunk_graph, and compare current outgoings with last compilation, in this stage, all optimizations are already applied.

Long term solution

When incremental for build_chunk_graph is stable, we no longer need to detect the changes and skip creating chunks, as incremental build chunks is performant enough

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 9054048
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67be8eb1e5f36400081b969d
😎 Deploy Preview https://deploy-preview-9453--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JSerFeng JSerFeng changed the title fix: module graph change fix: detect module graph change right before build_chunk_graph Feb 25, 2025
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Feb 25, 2025
Copy link

codspeed-hq bot commented Feb 25, 2025

CodSpeed Performance Report

Merging #9453 will not alter performance

Comparing fix/module-graph-change (9054048) with main (9a6473c)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 7 untouched benchmarks

@JSerFeng JSerFeng force-pushed the fix/module-graph-change branch 2 times, most recently from c6b68bb to 506b32f Compare February 25, 2025 11:21
@JSerFeng JSerFeng force-pushed the fix/module-graph-change branch from 506b32f to 13bad2f Compare February 25, 2025 13:05
@JSerFeng JSerFeng force-pushed the fix/module-graph-change branch from 13bad2f to 9054048 Compare February 26, 2025 03:46
Copy link
Contributor

@ahabhgk ahabhgk left a comment

Choose a reason for hiding this comment

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

LGTM, cc @jerrykingxyz

@JSerFeng JSerFeng merged commit aa8555f into main Feb 26, 2025
27 checks passed
@JSerFeng JSerFeng deleted the fix/module-graph-change branch February 26, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants