بنقرة واحدة
rspack-perf
// Use when optimizing performance for user-specified files, features, compilation stages, Rust crates, JavaScript plugins, graph processing, parser work, chunking, code generation, or memory/CPU hot paths in Rspack.
// Use when optimizing performance for user-specified files, features, compilation stages, Rust crates, JavaScript plugins, graph processing, parser work, chunking, code generation, or memory/CPU hot paths in Rspack.
Create or update draft GitHub releases for the current project's main GitHub repository, then organize GitHub-generated release notes into user-friendly sections without rewriting release note items. Use for preparing, formatting, categorizing, creating, or updating GitHub release notes or draft releases.
Create the official Rspack release pull request for a stable or pre-release version bump. Use when the task is to prepare a formal release branch from a clean checkout, sync to the latest origin/main, run `./x version` with an optional `--pre alpha|beta|rc`, confirm the resulting JavaScript and Rust versions with the user, open the release PR, trigger Ecosystem CI, and report the PR plus workflow URLs.
Use sftrace, which is based on LLVM Xray instrumentation, to trace all Rust function calls. This can be used for performance analysis and troubleshooting.
Run Rspack's perf-guided optimization loop for `cases/all` and similar workloads: create an isolated worktree, build a profiling binding, benchmark with `RSPACK_BINDING`, collect and compare `perf` hotspots, implement small Rust changes, validate, commit, push, and trigger the Ecosystem Benchmark workflow after each pushed commit. Use this when the goal is iterative performance work, not just one-off profiling.
Run Rspack performance profiling on Linux using perf (with DWARF call stacks), generate perf.data, and analyze hotspots. Use when you need CPU-level bottlenecks, kernel symbol resolution, or repeatable profiling for rspack build/bench cases. Includes optional samply import with per-CPU threads for visualization, but primary analysis is perf-based.
| name | rspack-perf |
| description | Use when optimizing performance for user-specified files, features, compilation stages, Rust crates, JavaScript plugins, graph processing, parser work, chunking, code generation, or memory/CPU hot paths in Rspack. |
Optimize from the shape of Rspack's data. Always consider the rough cardinality of internal structures before changing an algorithm:
dependency/export_info > module/exports_info/module_graph_module > chunk > chunk_group > entry/runtime.
The larger the structure, the more dangerous full scans, repeated traversals, broad cloning, eager materialization, and per-item allocation become. Avoid whole-graph or whole-compilation work on high-cardinality structures unless profiling proves it is necessary.
rayon for CPU-bound synchronous work, use rspack_parallel abstractions for async orchestration, and avoid mixing rayon and tokio pools inside one workflow without a clear boundary.format!, .to_string(), and owned-string construction for identifiers, requests, resource names, runtime helpers, export names, and module ids.&str, interned strings, Atom, Arc<str>, or cached rendered strings where ownership is not required.Arc when ownership must cross phases.Vec, HashMap, HashSet, IndexMap, or combination lists inside high-cardinality loops.collect() followed by one traversal.FxHashMap/FxHashSet or identity hashing for interned or already-hashed keys.Vec plus stable indexes for dense key spaces.Functional validation:
pnpm run build:cli:dev before pnpm run test:unit.pnpm run test:unit after the optimization.Performance validation:
compilation stages case that directly covers the optimized feature.Before submitting:
pnpm run format:rs.pnpm run format:js.cargo clippy --workspace --all-targets --all-features.After the optimization is complete, ask the user whether they want to create a PR.
If the user wants a PR:
perf/.perf(<scope>): <summary> or perf: <summary>.perf: .Validation section in the PR body.gh workflow run 'Ecosystem Benchmark' -f pr=<pr-number>
gh run list --workflow 'Ecosystem Benchmark' --limit 5
Use the PR number as the workflow input. A run on main does not benchmark the PR branch.
If the user allows waiting for GitHub CI: