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: lazy require browserslist package #7963

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Sep 24, 2024

Summary

In most cases, Rspack does not need to require the browserslist package, it is only be used if target contains "browserslist".

Lazy require browserslist can make Rspack startup 17ms faster.

  • before:
Screenshot 2024-09-24 at 17 20 31
  • after:
Screenshot 2024-09-24 at 17 20 44

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 Sep 24, 2024
@github-actions github-actions bot added the release: performance release: performance related release(mr only) label Sep 24, 2024
Copy link

netlify bot commented Sep 24, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit fdc4fdc
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66f28576dc3259000770189c

@chenjiahan
Copy link
Member Author

!bench

@rspack-bot
Copy link

rspack-bot commented Sep 24, 2024

📝 Benchmark detail: Open

Name Base (2024-09-24 ce775cc) Current Change
10000_development-mode + exec 2.22 s ± 47 ms 2.27 s ± 41 ms +1.96 %
10000_development-mode_hmr + exec 687 ms ± 7.8 ms 707 ms ± 16 ms +2.92 %
10000_production-mode + exec 2.8 s ± 38 ms 2.92 s ± 29 ms +4.28 %
arco-pro_development-mode + exec 1.84 s ± 83 ms 1.84 s ± 70 ms +0.07 %
arco-pro_development-mode_hmr + exec 434 ms ± 1.9 ms 437 ms ± 2.7 ms +0.76 %
arco-pro_production-mode + exec 3.25 s ± 61 ms 3.32 s ± 81 ms +2.23 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.32 s ± 67 ms 3.36 s ± 82 ms +1.27 %
threejs_development-mode_10x + exec 1.68 s ± 21 ms 1.71 s ± 13 ms +1.32 %
threejs_development-mode_10x_hmr + exec 781 ms ± 7.9 ms 787 ms ± 18 ms +0.72 %
threejs_production-mode_10x + exec 5.11 s ± 31 ms 5.27 s ± 29 ms +3.05 %

@chenjiahan chenjiahan merged commit b1e8ecd into main Sep 24, 2024
35 checks passed
@chenjiahan chenjiahan deleted the browserslist_package_0924 branch September 24, 2024 11:11
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.

3 participants