perf(core): use dense storage for dependency connections#14148
Conversation
Co-authored-by: hardfist <1562502418@qq.com>
Co-authored-by: hardfist <1562502418@qq.com>
|
Cursor Agent can help with this pull request. Just |
📦 Binary Size-limit
❌ Size increased by 4.00KB from 61.76MB to 61.76MB (⬆️0.01%) |
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📦 Download Diff Report: popular-libs Bundle Diff Generated by Rsdoctor GitHub Action |
Merging this PR will improve performance by 10.34%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | rust@build_chunk_graph |
72.3 ms | 69.8 ms | +3.63% |
| ⚡ | Simulation | rust@create_named_chunk_ids |
6.6 ms | 6.2 ms | +7.36% |
| ⚡ | Simulation | rust@module_graph_api |
11.7 ms | 8.1 ms | +43.61% |
| ⚡ | Simulation | rust@flag_dependency_exports |
11.4 ms | 10.9 ms | +4.28% |
| ⚡ | Simulation | rust@create_chunk_ids |
6.7 ms | 6.3 ms | +6.06% |
| ⚡ | Simulation | rust@create_concatenate_module |
34.1 ms | 33.4 ms | +2.14% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cursor/dense-dependency-connections-8c76 (33cc9df) with main (c6fb557)
Footnotes
-
25 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. ↩
Co-authored-by: hardfist <1562502418@qq.com>
This reverts commit 6097bd2.
|
📝 Benchmark detail: Open No benchmark data for commit 0ccfa7b, trying parent...
Base persistent cache hit rate: 👍 Current persistent cache hit rate: 👍 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33cc9dfa7c
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR introduces a dense, DependencyId-indexed overlay storage for ModuleGraph connections to reduce hash lookups on the hot connection_by_dependency_id path while keeping the existing checkpoint/reset rollback semantics.
Changes:
- Added
DenseDependencyIdOverlayMap(Vec-backed base + optional overlay) forDependencyId-indexed storage. - Switched
ModuleGraphData.connectionsto use the dense overlay map instead of a hashedOverlayMap. - Exported the new dense overlay map via the rollback module.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/rspack_core/src/module_graph/rollback/mod.rs | Exposes the new dense overlay map module and re-exports it. |
| crates/rspack_core/src/module_graph/rollback/dense_dependency_id_overlay_map.rs | Implements Vec-backed overlay storage indexed by DependencyId, including unit tests. |
| crates/rspack_core/src/module_graph/mod.rs | Replaces hashed connection storage with the new dense overlay map for faster lookup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Use dense
DependencyId-indexed overlay storage for module graph connections to avoid hash lookups on the hotconnection_by_dependency_idpath while preserving checkpoint/reset behavior.Note: the paged dense storage follow-up was reverted in
33cc9dfa7cper request.Related links
N/A
Checklist