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: enable "fat" LTO for production release #7088

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jul 9, 2024

Summary

Pros

  • Better performance (according to benchmark): 1% ~ 3% faster
  • Smaller binary size (rspack.darwin-arm64.node): 55.4 MB -> 51.7 MB

Cons

  • Longer build time, only affect the production release: 4-5min -> 8-10min

see:

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 9, 2024
Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 8c8e09a
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/668cda58ec84d10008d9c2d9

@chenjiahan
Copy link
Member Author

!bench

@rspack-bot
Copy link

rspack-bot commented Jul 9, 2024

📝 Benchmark detail: Open

Name Base (2024-07-09 f2bc023) Current Change
10000_development-mode + exec 2.18 s ± 17 ms 2.13 s ± 27 ms -2.03 %
10000_development-mode_hmr + exec 688 ms ± 7.5 ms 693 ms ± 10 ms +0.62 %
10000_production-mode + exec 2.81 s ± 26 ms 2.7 s ± 18 ms -3.87 %
arco-pro_development-mode + exec 1.91 s ± 55 ms 1.89 s ± 68 ms -0.83 %
arco-pro_development-mode_hmr + exec 433 ms ± 1.8 ms 433 ms ± 0.62 ms -0.19 %
arco-pro_production-mode + exec 3.46 s ± 90 ms 3.43 s ± 56 ms -0.94 %
threejs_development-mode_10x + exec 1.57 s ± 16 ms 1.58 s ± 12 ms +0.57 %
threejs_development-mode_10x_hmr + exec 795 ms ± 8.4 ms 820 ms ± 3 ms +3.23 %
threejs_production-mode_10x + exec 5.58 s ± 22 ms 5.55 s ± 55 ms -0.46 %

@chenjiahan chenjiahan changed the title perf: enable "fat" LTO for release perf: enable "fat" LTO for production release Jul 9, 2024
@chenjiahan chenjiahan requested a review from SyMind July 9, 2024 06:35
@JSerFeng
Copy link
Collaborator

JSerFeng commented Jul 9, 2024

Cool, I thought we were already use fat in production release long ago

@chenjiahan
Copy link
Member Author

I thought we were already use fat in production release long ago

Haha, I guess the reason for using "thin" before was mainly due to CI time. And it is worth to enable "fat" if it only affects the prod release

@chenjiahan chenjiahan merged commit 092a49a into main Jul 9, 2024
29 checks passed
@chenjiahan chenjiahan deleted the lto_flat_0709 branch July 9, 2024 06:56
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.

4 participants