Skip to content

Conversation

LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Sep 3, 2025

Summary

We can make sure that chunk module exists when it is not a runtime module, then we can prevent finding all modules on module graph by loop_partial which needs to indexing multiple times.

Before:
image

After:
image

Related links

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings September 3, 2025 10:36
Copy link

netlify bot commented Sep 3, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 0c2800d
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68ba66fd93bf81000898cc03
😎 Deploy Preview https://deploy-preview-11575--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 project configuration.

@github-actions github-actions bot added release: performance release: performance related release(mr only) team The issue/pr is created by the member of Rspack. labels Sep 3, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

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 improves the performance of deterministic chunk ID generation by optimizing module ordering operations. The changes replace calls that fetch full module objects with more efficient operations that work directly with module identifiers, reducing unnecessary object allocations and improving sorting performance.

  • Replaced get_ordered_chunk_modules with get_ordered_chunk_normal_modules_identifier for better performance
  • Added new optimized method that returns module identifiers directly instead of full module objects
  • Enhanced dependency traversal logic with cycle detection for ExtractCSS dependencies

Reviewed Changes

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

File Description
crates/rspack_ids/src/id_helpers.rs Updated chunk comparison to use optimized identifier-based module ordering
crates/rspack_core/src/chunk_graph/chunk_graph_chunk.rs Added new efficient method for getting ordered module identifiers and improved dependency handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

github-actions bot commented Sep 3, 2025

📦 Binary Size-limit

Comparing 0c2800d to chore(deps): update crate swc_core to v38.0.1 (#11586) by renovate[bot]

🎉 Size decreased by 1.88KB from 47.25MB to 47.24MB (⬇️0.00%)

Copy link

codspeed-hq bot commented Sep 3, 2025

CodSpeed Performance Report

Merging #11575 will not alter performance

Comparing perf/improve-deterministirc-chunk-ids (0c2800d) with main (61f2dfa)1

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

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

✅ 17 untouched benchmarks

Footnotes

  1. No successful run was found on main (b77879c) during the generation of this report, so 61f2dfa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LingyuCoder LingyuCoder requested a review from ahabhgk September 4, 2025 05:22
@LingyuCoder LingyuCoder enabled auto-merge (squash) September 4, 2025 05:22
@LingyuCoder LingyuCoder merged commit bfed4d2 into main Sep 5, 2025
68 of 70 checks passed
@LingyuCoder LingyuCoder deleted the perf/improve-deterministirc-chunk-ids branch September 5, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance 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.

2 participants