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 swc loader #7965

Merged
merged 3 commits into from
Oct 18, 2024
Merged

Conversation

CPunisher
Copy link
Contributor

@CPunisher CPunisher commented Sep 24, 2024

Summary

Checklist

Assume:

  1. Creating an SwcLoaderJsOptions is costly
  2. Most modules are created with same swc loader options

Cost:

  1. RwLock and concurrent runtime.
    Maybe there is a better cache strategy.

🙏 Help me run the benchmark.

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

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

Built without sensitive environment variables

Name Link
🔨 Latest commit e0e0f29
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/670a8d0c4d213a0008217b79

@JSerFeng
Copy link
Collaborator

!bench

@JSerFeng JSerFeng self-assigned this Sep 25, 2024
@rspack-bot
Copy link

rspack-bot commented Sep 25, 2024

📝 Benchmark detail: Open

Name Base (2024-09-25 5fd46ef) Current Change
10000_development-mode + exec 2.27 s ± 30 ms 2.23 s ± 23 ms -1.93 %
10000_development-mode_hmr + exec 701 ms ± 15 ms 704 ms ± 12 ms +0.34 %
10000_production-mode + exec 2.93 s ± 20 ms 2.89 s ± 38 ms -1.51 %
arco-pro_development-mode + exec 1.84 s ± 80 ms 1.87 s ± 93 ms +1.72 %
arco-pro_development-mode_hmr + exec 436 ms ± 2.9 ms 436 ms ± 3.4 ms -0.09 %
arco-pro_production-mode + exec 3.32 s ± 72 ms 3.29 s ± 91 ms -0.76 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.35 s ± 98 ms 3.38 s ± 79 ms +0.96 %
threejs_development-mode_10x + exec 1.7 s ± 17 ms 1.7 s ± 14 ms -0.06 %
threejs_development-mode_10x_hmr + exec 788 ms ± 9.3 ms 792 ms ± 15 ms +0.47 %
threejs_production-mode_10x + exec 5.26 s ± 11 ms 5.27 s ± 34 ms +0.01 %

@JSerFeng
Copy link
Collaborator

Thanks.

Modules in our bench cases are not that many, so the benefits may not be so obvious, but personally I think it's great for some large projects

@CPunisher CPunisher marked this pull request as ready for review September 25, 2024 10:56
@chenjiahan
Copy link
Member

@JSerFeng can we merge this

@chenjiahan
Copy link
Member

!eco-ci

@rspack-bot
Copy link

rspack-bot commented Oct 11, 2024

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
rspress ✅ success
rslib ❌ failure
rsbuild ✅ success
examples ✅ success
devserver ✅ success

@CPunisher CPunisher marked this pull request as draft October 12, 2024 08:18
@JSerFeng
Copy link
Collaborator

JSerFeng commented Oct 14, 2024

@JSerFeng can we merge this

sure, I'll approve once this is not draft

@CPunisher CPunisher marked this pull request as ready for review October 14, 2024 06:40
@chenjiahan chenjiahan merged commit 27f197c into web-infra-dev:main Oct 18, 2024
30 checks passed
@chenjiahan
Copy link
Member

🎉

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.

4 participants