test(benchmark): add compilation stage benchmark cases#13702
test(benchmark): add compilation stage benchmark cases#13702LingyuCoder wants to merge 8 commits intomainfrom
Conversation
📦 Binary Size-limit
🎉 Size decreased by 6.97KB from 49.39MB to 49.38MB (⬇️0.01%) |
Rsdoctor Bundle Diff Analysis
Found 6 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
63037a3 to
bc21247
Compare
Merging this PR will degrade performance by 2.3%
Performance Changes
Comparing Footnotes |
8ccd56d to
248fd9c
Compare
Deploying rspack with
|
| Latest commit: |
248fd9c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f8220905.rspack-v2.pages.dev |
| Branch Preview URL: | https://codex-compilation-stage-benc.rspack-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds new stage-isolated Rust CodSpeed benchmark cases to measure individual compilation passes, along with benchmark-local setup/reset helpers to keep each stage’s measurement focused.
Changes:
- Add new benchmarks for several compilation stages (mangle exports, runtime requirements, full hash, module assets, chunk assets, real content hash).
- Add benchmark-local helpers to prepare/reset compilation state between iterations.
- Expose several internal compilation pass types (and
DisableCache) via new public re-exports inrspack_core.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| xtask/benchmark/benches/groups/compilation_stages.rs | Adds new stage benchmarks and helpers to snapshot/reset compilation state and run individual passes. |
| crates/rspack_core/src/compilation/mod.rs | Publicly re-exports multiple pass types from private compilation modules. |
| crates/rspack_core/src/cache/mod.rs | Publicly re-exports DisableCache to support benchmarks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb0197d1b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Add stage-isolated Rust CodSpeed benchmark cases in
xtask/benchmark/benches/groups/compilation_stages.rsfor:rust@mangle_exportsrust@runtime_requirementsrust@create_full_hashrust@create_chunk_assetsrust@create_module_assetsrust@real_content_hashThis also adds the benchmark-local setup/reset helpers needed to keep those stages isolated without changing
rspack_corepublic visibility.Related links
Validation
cargo check -p rspack_benchmark --bench benchescargo fmt --all --checkKnown limitations
rspack_coreAPI visibility.runtime_requirementsandcreate_chunk_assetsbenches may still differ from the exact production execution model in scheduling/parallelism overhead, so they should be treated as draft until that fidelity is reviewed.Checklist