Skip to content

perf: lazy require browserslist package#7963

Merged
chenjiahan merged 1 commit intomainfrom
browserslist_package_0924
Sep 24, 2024
Merged

perf: lazy require browserslist package#7963
chenjiahan merged 1 commit intomainfrom
browserslist_package_0924

Conversation

@chenjiahan
Copy link
Copy Markdown
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
@netlify
Copy link
Copy Markdown

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
Copy Markdown
Member Author

!bench

@rspack-bot
Copy link
Copy Markdown

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
@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