perf: avoid parsing concatenated module codegen#14852
Conversation
📦 Binary Size-limit
❌ Size increased by 120.00KB from 66.60MB to 66.72MB (⬆️0.18%) |
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff 🤖 AI Degradation Analysis (Click to expand)📊 Size ChangesNo significant regressions detected 🎉. 🔍 Root Cause Analysis
|
Merging this PR will improve performance by 14.07%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | bundle@threejs-production-sourcemap |
192.9 ms | 155 ms | +24.46% |
| ⚡ | Simulation | rust@concatenate_module_code_generation |
45.1 ms | 39.2 ms | +15.21% |
| ⚡ | Simulation | bundle@misc-production-sourcemap |
3.7 s | 3.5 s | +3.53% |
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 seal/concat-local-ident (315eb5e) with main (e8a7bce)
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. ↩
Summary
The earlier approach in #14033 added a second AST traversal and persisted high-cardinality identifier/reference maps for every eligible ESM module. That shifted substantial allocation, serialization, and cache-restore work into make while still rebuilding name-analysis state during code generation. This version fuses collection into an existing visitor, stores only compact identifier records, and resolves generated bindings lazily from dependency-template metadata.
The focused optimized-profile benchmark is approximately 6.98 ms locally versus 7.07 ms on
origin/mainforrust@concatenate_module_code_generation. CI CodSpeed is the final performance gate.Related links
Checklist