-
-
Notifications
You must be signed in to change notification settings - Fork 787
perf: Update swc and switch to wasmtime #11303
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
Conversation
✅ Deploy Preview for rspack canceled.
|
06c805f
to
2163d74
Compare
📦 Binary Size-limit
🎉 Size decreased by 2.76MB from 50.38MB to 47.62MB (⬇️5.48%) |
ddde9ab
to
9de33dc
Compare
CodSpeed Performance ReportMerging #11303 will not alter performanceComparing 🎉 Hooray!
|
f201f0e
to
76d0202
Compare
📝 Benchmark detail: Open
Threshold exceeded: ["10000_big_production-mode_disable-minimize + exec","10000_development-mode + exec","10000_production-mode + exec","10000_production-mode_persistent-cold + exec","large-dyn-imports_development-mode + exec","large-dyn-imports_production-mode + exec","10000_development-mode + rss memory","10000_development-mode_hmr + rss memory","10000_production-mode + rss memory","10000_production-mode_persistent-cold + rss memory","arco-pro_development-mode_hmr + rss memory"] |
📝 Benchmark detail: Open
Threshold exceeded: ["10000_big_production-mode_disable-minimize + exec","10000_development-mode + exec","10000_production-mode + exec","10000_production-mode_persistent-cold + exec","large-dyn-imports_development-mode + exec","large-dyn-imports_production-mode + exec","10000_development-mode + rss memory","10000_development-mode_hmr + rss memory","10000_production-mode + rss memory","10000_production-mode_persistent-cold + rss memory","arco-pro_development-mode + rss memory","arco-pro_development-mode_hmr + rss memory"] |
) **Description:** Currently, `wasmtime-wasi` uses tokio `block_on` internally, which causes panic when used in the tokio runtime. I originally thought this could be solved by use `block_in_place`, but the large scope of `block_in_place` caused a serious performance regression (even without use plugin). see web-infra-dev/rspack#11303 (comment) Switch to `wasi-common` is a better choice, which simplifies the wasi implment and makes it independent of tokio.
📝 Benchmark detail: Open
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates SWC dependencies and switches the WebAssembly runtime from wasmer to wasmtime for plugin execution. The update brings SWC from version 33.0.0 to 35.0.0 and introduces wasmtime as the new WASM runtime backend.
Key changes include:
- Update SWC core and related dependencies to version 35.0.0
- Replace wasmer-based plugin runtime with wasmtime implementation
- Clean up dependency allowlist in deny.toml by removing unused crates
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
crates/rspack_workspace/src/generated.rs | Updates SWC version constant from 33.0.0 to 35.0.0 |
crates/rspack_util/src/swc/runtime.rs | Adds new wasmtime-based plugin runtime implementation |
crates/rspack_util/src/swc.rs | Exposes the new runtime module under plugin feature flag |
crates/rspack_util/Cargo.toml | Adds wasmtime and related dependencies for plugin feature |
crates/rspack_loader_swc/src/lib.rs | Integrates wasmtime runtime into SWC loader configuration |
crates/rspack_loader_swc/Cargo.toml | Updates plugin feature dependencies to use wasmtime |
crates/rspack_binding_api/src/swc.rs | Integrates wasmtime runtime into binding API |
crates/rspack_binding_api/Cargo.toml | Adds rspack_util plugin feature dependency |
Cargo.toml | Updates SWC package versions and adds wasmtime dependencies |
deny.toml | Removes unused dependency allowlist entries |
packages/rspack-test-tools/tests/watchCases/build-chunk-graph/runtime-chunk-recover-error/1/errors.js | Updates expected error messages for new parser |
Could you add a PR description? 😄 |
Summary
This PR updates the swc version to
35.0.0
and switch the swc plugin runner backend from wasmer to wasmtime.Related links
wasmtime
backend swc-project/swc#10958Checklist