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: improve determine_export_assignments #6431

Merged
merged 6 commits into from
May 16, 2024

Conversation

quininer
Copy link
Contributor

@quininer quininer commented May 1, 2024

Summary

This is an optimization for TypeScript repo build hotspot. I did some performance tests before the 5-1, but now the results have been destroyed along with harddisk.

  • Use .chain instead of .clone + .push
  • eliminate Atom drop by avoiding redundant Atom clone
  • eliminate Atom clone
  • rewrite collect hidden_exports

Checklist

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

Copy link

netlify bot commented May 1, 2024

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 151a5a3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/663db9444bb6b00008738b91
😎 Deploy Preview https://deploy-preview-6431--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.

@quininer quininer changed the title improve determine_export_assignments perf: improve determine_export_assignments May 1, 2024
@github-actions github-actions bot added the release: performance release: performance related release(mr only) label May 1, 2024
@quininer
Copy link
Contributor Author

quininer commented May 1, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented May 1, 2024

📝 Benchmark detail: Open

task failure

@rspack-bot
Copy link

rspack-bot commented May 6, 2024

📝 Benchmark detail: Open

Name Base (2024-05-06 42527c5) Current Change
10000_development-mode + exec 2.77 s ± 40 ms 2.79 s ± 29 ms +0.79 %
10000_development-mode_hmr + exec 684 ms ± 3.9 ms 685 ms ± 12 ms +0.18 %
10000_production-mode + exec 2.5 s ± 26 ms 2.49 s ± 31 ms -0.23 %
arco-pro_development-mode + exec 2.61 s ± 43 ms 2.58 s ± 78 ms -0.93 %
arco-pro_development-mode_hmr + exec 429 ms ± 2.9 ms 429 ms ± 1.8 ms -0.16 %
arco-pro_development-mode_hmr_intercept-plugin + exec 441 ms ± 2 ms 441 ms ± 1.7 ms -0.02 %
arco-pro_development-mode_intercept-plugin + exec 3.37 s ± 64 ms 3.4 s ± 66 ms +0.86 %
arco-pro_production-mode + exec 4.08 s ± 57 ms 4.11 s ± 76 ms +0.63 %
arco-pro_production-mode_intercept-plugin + exec 4.87 s ± 55 ms 4.9 s ± 85 ms +0.62 %
threejs_development-mode_10x + exec 2.09 s ± 23 ms 2.09 s ± 25 ms +0.15 %
threejs_development-mode_10x_hmr + exec 760 ms ± 16 ms 760 ms ± 24 ms +0.02 %
threejs_production-mode_10x + exec 5.16 s ± 26 ms 5.21 s ± 31 ms +1.00 %

@rspack-bot
Copy link

rspack-bot commented May 9, 2024

📝 Benchmark detail: Open

Name Base (2024-05-09 584a24f) Current Change
10000_development-mode + exec 2.72 s ± 28 ms 2.8 s ± 34 ms +3.18 %
10000_development-mode_hmr + exec 696 ms ± 3.2 ms 688 ms ± 9.9 ms -1.07 %
10000_production-mode + exec 2.5 s ± 26 ms 2.51 s ± 44 ms +0.48 %
arco-pro_development-mode + exec 2.46 s ± 79 ms 2.64 s ± 83 ms +7.29 %
arco-pro_development-mode_hmr + exec 428 ms ± 2.6 ms 430 ms ± 1.9 ms +0.41 %
arco-pro_development-mode_hmr_intercept-plugin + exec 439 ms ± 2.1 ms 443 ms ± 3.1 ms +0.99 %
arco-pro_development-mode_intercept-plugin + exec 3.3 s ± 72 ms 3.43 s ± 60 ms +3.81 %
arco-pro_production-mode + exec 4.01 s ± 76 ms 4.07 s ± 67 ms +1.67 %
arco-pro_production-mode_intercept-plugin + exec 4.89 s ± 84 ms 4.92 s ± 104 ms +0.58 %
threejs_development-mode_10x + exec 1.99 s ± 17 ms 2.11 s ± 16 ms +5.88 %
threejs_development-mode_10x_hmr + exec 752 ms ± 9.1 ms 769 ms ± 5.2 ms +2.29 %
threejs_production-mode_10x + exec 5.19 s ± 18 ms 5.24 s ± 35 ms +1.12 %

Threshold exceeded: ["arco-pro_development-mode + exec","threejs_development-mode_10x + exec"]

@quininer
Copy link
Contributor Author

quininer commented May 9, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented May 9, 2024

📝 Benchmark detail: Open

Name Base (2024-05-09 584a24f) Current Change
10000_development-mode + exec 2.72 s ± 28 ms 2.73 s ± 34 ms +0.36 %
10000_development-mode_hmr + exec 696 ms ± 3.2 ms 699 ms ± 6.1 ms +0.40 %
10000_production-mode + exec 2.5 s ± 26 ms 2.51 s ± 16 ms +0.24 %
arco-pro_development-mode + exec 2.46 s ± 79 ms 2.49 s ± 59 ms +1.35 %
arco-pro_development-mode_hmr + exec 428 ms ± 2.6 ms 429 ms ± 1.4 ms +0.21 %
arco-pro_development-mode_hmr_intercept-plugin + exec 439 ms ± 2.1 ms 439 ms ± 2.6 ms +0.10 %
arco-pro_development-mode_intercept-plugin + exec 3.3 s ± 72 ms 3.32 s ± 76 ms +0.61 %
arco-pro_production-mode + exec 4.01 s ± 76 ms 4.06 s ± 87 ms +1.38 %
arco-pro_production-mode_intercept-plugin + exec 4.89 s ± 84 ms 4.87 s ± 69 ms -0.32 %
threejs_development-mode_10x + exec 1.99 s ± 17 ms 1.97 s ± 15 ms -0.86 %
threejs_development-mode_10x_hmr + exec 752 ms ± 9.1 ms 763 ms ± 18 ms +1.43 %
threejs_production-mode_10x + exec 5.19 s ± 18 ms 5.17 s ± 18 ms -0.20 %

* Use .chain instead of .clone + .push
* eliminate Atom drop by avoiding redundant Atom clone
* Remove IndexSet and insert directly into Vec.
* eliminate Atom clone
* rewrite collect hidden_exports
@quininer quininer merged commit 9572d63 into web-infra-dev:main May 16, 2024
29 checks passed
@quininer quininer deleted the perf-js-plug-esm branch May 16, 2024 04:50
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants