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

perf: cache compilation.entrypoints #7059

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jul 6, 2024

Summary

Cache compilation.entrypoints to improve performance, it is similar to compilation.#cachedAssets.

The performance cost of compilation.entrypoints is noticeable when using html-webpack-plugin.

I have tested it in a MPA project (https://github.com/liangyuetian/rsbuild-hmr-slow-demo) with 200+ entries:

  • without cache, it took 500ms (total) to get compilation.entrypoints:
截屏2024-07-06 19 31 24
  • with cache, it took 2.5ms (total) to get compilation.entrypoints:
截屏2024-07-06 20 02 30

Checklist

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

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

netlify bot commented Jul 6, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 99a1be8
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/668933d4fc4a0d00086f1805

@chenjiahan
Copy link
Member Author

!bench

@rspack-bot
Copy link

rspack-bot commented Jul 6, 2024

📝 Benchmark detail: Open

Name Base (2024-07-06 9c307b7) Current Change
10000_development-mode + exec 2.15 s ± 16 ms 2.16 s ± 29 ms +0.66 %
10000_development-mode_hmr + exec 687 ms ± 5.4 ms 690 ms ± 6.1 ms +0.39 %
10000_production-mode + exec 2.76 s ± 29 ms 2.76 s ± 21 ms -0.12 %
arco-pro_development-mode + exec 1.84 s ± 43 ms 1.9 s ± 66 ms +2.92 %
arco-pro_development-mode_hmr + exec 434 ms ± 1.2 ms 433 ms ± 1.1 ms -0.23 %
arco-pro_production-mode + exec 3.47 s ± 76 ms 3.45 s ± 57 ms -0.62 %
threejs_development-mode_10x + exec 1.57 s ± 13 ms 1.58 s ± 18 ms +0.66 %
threejs_development-mode_10x_hmr + exec 794 ms ± 6.5 ms 795 ms ± 8.4 ms +0.18 %
threejs_production-mode_10x + exec 5.59 s ± 28 ms 5.59 s ± 32 ms -0.04 %

@chenjiahan chenjiahan requested review from ahabhgk and h-a-n-a and removed request for ahabhgk July 6, 2024 12:26
@chenjiahan chenjiahan merged commit 03e0488 into main Jul 8, 2024
40 checks passed
@chenjiahan chenjiahan deleted the cache_entrypoints_0706 branch July 8, 2024 08:53
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.

None yet

3 participants