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

refactor: module hash #7569

Merged
merged 8 commits into from
Aug 15, 2024
Merged

refactor: module hash #7569

merged 8 commits into from
Aug 15, 2024

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Aug 14, 2024

Summary

introduce module (chunk graph module) hash to optimize codegen phase when rebuild, this add a new phase create_module_hashes to calculate module hash

  • for now, we use it as cache key in codegen phase
  • other phases like process_runtime_requirements will also use it as cache key in future PR
  • will improve it to incremental to avoid the cost of cache read and cache key compare
  • will improve it to only calculate affected modules hash when rebuild (need some refactor in make phase to achieve that), for now we calculate all modules hash when rebuild
  • create_module_hashes cause start time slower a bit, but this is necessary and will improve it from other phases

Checklist

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

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Aug 14, 2024
Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 50bb11f
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66bd928562f3570008a47bfa

@ahabhgk ahabhgk force-pushed the refactor-module-hash branch from 4cab65e to 503e26c Compare August 14, 2024 11:29
@ahabhgk
Copy link
Contributor Author

ahabhgk commented Aug 14, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented Aug 14, 2024

📝 Benchmark detail: Open

Name Base (2024-08-14 496d277) Current Change
10000_development-mode + exec 2.3 s ± 22 ms 2.33 s ± 26 ms +1.00 %
10000_development-mode_hmr + exec 695 ms ± 9.6 ms 717 ms ± 11 ms +3.26 %
10000_production-mode + exec 2.86 s ± 30 ms 3.01 s ± 28 ms +5.41 %
arco-pro_development-mode + exec 1.89 s ± 63 ms 1.9 s ± 59 ms +0.90 %
arco-pro_development-mode_hmr + exec 435 ms ± 2.7 ms 439 ms ± 2 ms +0.88 %
arco-pro_production-mode + exec 3.4 s ± 81 ms 3.42 s ± 89 ms +0.55 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.46 s ± 67 ms 3.5 s ± 81 ms +1.23 %
threejs_development-mode_10x + exec 1.68 s ± 12 ms 1.71 s ± 14 ms +1.79 %
threejs_development-mode_10x_hmr + exec 795 ms ± 12 ms 828 ms ± 10 ms +4.11 %
threejs_production-mode_10x + exec 5.46 s ± 22 ms 5.56 s ± 40 ms +1.84 %

Threshold exceeded: ["10000_production-mode + exec"]

@ahabhgk ahabhgk marked this pull request as ready for review August 15, 2024 04:49
@ahabhgk ahabhgk requested a review from jerrykingxyz as a code owner August 15, 2024 04:49
@ahabhgk ahabhgk enabled auto-merge (squash) August 15, 2024 04:50
@ahabhgk ahabhgk force-pushed the refactor-module-hash branch from 8b51bb1 to 01caa0c Compare August 15, 2024 05:22
@ahabhgk ahabhgk merged commit a5e3212 into main Aug 15, 2024
28 checks passed
@ahabhgk ahabhgk deleted the refactor-module-hash branch August 15, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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