perf: use a dense ModuleGraph connection rollback journal#14745
perf: use a dense ModuleGraph connection rollback journal#14745hardfist wants to merge 1 commit into
Conversation
📦 Binary Size-limit
🎉 Size decreased by 4.00KB from 66.42MB to 66.42MB (⬇️0.01%) |
Merging this PR will improve performance by 4.49%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | rust@create_named_chunk_ids |
2.9 ms | 3 ms | -2.45% |
| ❌ | Simulation | rust@create_chunk_ids |
3 ms | 3.1 ms | -2.23% |
| ⚡ | Simulation | rust@module_graph_api |
3.5 ms | 2.9 ms | +22.11% |
| ⚡ | Simulation | rust@create_named_module_ids |
3.2 ms | 3.1 ms | +2.36% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/compact-module-graph-connection-overlay (03b8224) with main (95c928f)
Footnotes
-
47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
ad116a8 to
03b8224
Compare
|
📝 Benchmark detail: Open
Base persistent cache hit rate: 👍 Current persistent cache hit rate: 👍 |
Summary
This targets the high-cardinality dependency path in ModuleGraph. Connection reads heavily outnumber checkpoint mutations during module concatenation, so moving rollback work to the mutation/reset side removes the overlay branch and secondary value lookup from the hot read path.
The focused
rust@create_concatenate_moduleCallgrind stage improved from 47,436,218 to 47,026,994 instructions on the same local build path: -409,224 Ir (-0.86%). Three consecutive final measurements produced the same result. Compared with the previous compact-overlay implementation in this PR, the journal removes 512,454 Ir (-1.08%).Checked with six focused Rust rollback tests,
pnpm run build:cli:dev,pnpm run test:unit(46 files and 8,787 tests passed), Rust/JS formatting, andcargo clippy -p rspack_core --all-targets. The workspace-wide all-features Clippy command remains blocked by the existing rkyv 0.7/0.8 conflict inrspack_cacheable.Related links
Checklist