Skip to content

perf: cache swc loader#7965

Merged
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
CPunisher:perf/cache-swc-loader
Oct 18, 2024
Merged

perf: cache swc loader#7965
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
CPunisher:perf/cache-swc-loader

Conversation

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

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
Copy Markdown
Contributor

!bench

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

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
Copy Markdown
Contributor

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 chenjiahan requested a review from JSerFeng September 25, 2024 14:11
@chenjiahan
Copy link
Copy Markdown
Member

@JSerFeng can we merge this

@chenjiahan
Copy link
Copy Markdown
Member

!eco-ci

@rspack-bot
Copy link
Copy Markdown

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 force-pushed the perf/cache-swc-loader branch from e798cba to dd1b3be Compare October 12, 2024 07:21
@CPunisher CPunisher marked this pull request as draft October 12, 2024 08:18
@CPunisher CPunisher force-pushed the perf/cache-swc-loader branch from a0bc2b2 to e0e0f29 Compare October 12, 2024 14:51
@JSerFeng
Copy link
Copy Markdown
Contributor

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