Skip to content

perf: use indexed names for faster concatenation - #15222

Closed
LingyuCoder wants to merge 12 commits into
mainfrom
seal/concat-rebind
Closed

LingyuCoder wants to merge 12 commits into
mainfrom
seal/concat-rebind

Conversation

@LingyuCoder

Copy link
Copy Markdown
Contributor

Summary

This is an experimental follow-up to #14852 for measuring the naming phase with CodSpeed.

  • Use deterministic __m{module_index}_{binding_index} names for conflicting module-scope bindings when faster module concatenation is enabled.
  • Keep the complete used-name collision check and append a numeric suffix for the rare indexed-name collision.
  • Skip escaped-name preparation for module bindings on the faster path while preserving the legacy naming path unchanged.

Related links

Validation

  • pnpm run build:binding:dev
  • pnpm --filter @rspack/tests test FasterModuleConcatenation.test.js (84 passed)
  • Legacy and runtime-mode rename-10168 cases

Checklist

  • Tests updated.
  • Documentation not required for this experiment.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 8431b70 to chore: fix lint and formatting by harpsealjs

⏳ The base commit triggered a linux binding build, but its binary size data has not been generated yet, so the size comparison is skipped.

Please re-run this workflow once the ecosystem-benchmark data for that commit is published.

Warning

Reference only — not the real baseline. The base commit's data isn't ready yet, so this compares against the nearest earlier commit that has data (3857d21) for a rough estimate:

❌ Size increased by 248.00KB from 68.20MB to 68.44MB (⬆️0.36%)

@codspeed

codspeed Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 18.16%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 47 untouched benchmarks
⏩ 47 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@concatenate_module_code_generation 33.7 ms 24.6 ms +36.68%
Simulation bundle@misc-production-sourcemap 3.4 s 3.3 s +2.15%

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-rebind (8431b70) with seal/concat-local-ident (d84ab09)

Open in CodSpeed

Footnotes

  1. 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.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (7830b53a3b) does not have baseline artifacts. Using commit 6f868345d8 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 556.7 KB +345.0 B (0.0%) +204.0 B (0.0%)
ui-components 4.9 MB 1.4 MB +543.0 B (0.0%) +179.0 B (0.0%)
react-1k 823.1 KB 218.4 KB - -
react-5k 2.7 MB 669.3 KB 0 -2.0 B (-0.0%)
react-10k 5.6 MB 1.3 MB 0 -3.0 B (-0.0%)
📋 Detailed Reports (Click to expand)

📁 popular-libs

Path: ../build-tools-performance/cases/popular-libs/dist/rsdoctor-data.json

📌 Baseline Commit: 6f868345d8 | PR: #15218

Metric Current Baseline Change
📊 Total Size 1.7 MB 1.7 MB +345.0 B (0.0%)
🗜️ Gzip Size 556.7 KB 556.5 KB +204.0 B (0.0%)
📄 JavaScript 1.7 MB 1.7 MB +345.0 B (0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 289.0 B 289.0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: popular-libs Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: 6f868345d8 | PR: #15218

Metric Current Baseline Change
📊 Total Size 4.9 MB 4.9 MB +543.0 B (0.0%)
🗜️ Gzip Size 1.4 MB 1.4 MB +179.0 B (0.0%)
📄 JavaScript 4.8 MB 4.8 MB +543.0 B (0.0%)
🎨 CSS 112.5 KB 112.5 KB 0
🌐 HTML 328.0 B 328.0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 823.1 KB - -
🗜️ Gzip Size 218.4 KB - -
📄 JavaScript 822.7 KB - -
🎨 CSS 0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 6f868345d8 | PR: #15218

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0
🗜️ Gzip Size 669.3 KB 669.3 KB -2.0 B (-0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 328.0 B 328.0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-5k Bundle Diff

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 6f868345d8 | PR: #15218

Metric Current Baseline Change
📊 Total Size 5.6 MB 5.6 MB 0
🗜️ Gzip Size 1.3 MB 1.3 MB -3.0 B (-0.0%)
📄 JavaScript 5.6 MB 5.6 MB 0
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 328.0 B 328.0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-10k Bundle Diff

🤖 AI Degradation Analysis (Click to expand)

📁 popular-libs

📊 Size Changes

No significant regressions detected 🎉.

🔍 Root Cause Analysis

  • Micro-increases in motion-dom (+12%, 12 bytes) and proxy-compare (+5%, 10 bytes) are build noise.
  • Aggregate drift across stable dependencies (three, swiper, react-router) contributed to the total delta.

⚠️ Risk Assessment

Overall severity: Low

  • Initial chunk grew by 345 bytes (0.019%), resulting in no perceptible impact on LCP or FCP.

💡 Optimization Suggestions

  1. Audit three (117,659 bytes parsed) imports to ensure tree-shaking remains effective.
  2. Review react-router (83,961 bytes parsed) for route-based code-splitting opportunities.
  3. No immediate action required; maintain current build configuration.

Analysis by qwen3.5-plus

📁 ui-components

📊 Size Changes

Asset / Chunk Baseline Current Δ Size Δ % Initial?
No significant regressions detected 🎉

🔍 Root Cause Analysis

  • Total bundle size increased by only 543 bytes (5,138,933 → 5,139,476).
  • Minor fluctuations observed in internal utility modules (e.g., element-plus/es/utils/vue/vnode.mjs +76%, but absolute size <1 KB).
  • No new dependencies added; changes stem from existing library internal updates (antd, @arco-design, element-plus).

⚠️ Risk Assessment

Overall severity: Low

  • The initial chunk increased by 0.01% (+543 bytes), which is negligible for load time impact.

💡 Optimization Suggestions

  1. No action required: The delta is within noise tolerance for CI builds.
  2. Monitor trends: Continue watching element-plus and antd updates in future diffs to ensure no cumulative bloat.
  3. Verify build config: Ensure production builds are consistently using the same minification settings to prevent artificial drift.

Analysis by qwen3.5-plus

📁 react-5k

📊 Size Changes

No significant regressions detected 🎉.

🔍 Root Cause Analysis

  • No modules or packages were added, removed, or changed.
  • Bundle composition remains identical to baseline (Total JS: 2,793,626 bytes).

⚠️ Risk Assessment

Overall severity: Low

  • Zero byte delta across all asset types ensures no performance impact from this PR.

💡 Optimization Suggestions

  1. No action required based on bundle diff.
  2. Continue monitoring total bundle size (currently 2.7MB JS) in future audits to ensure long-term health.

Analysis by qwen3.5-plus

📁 react-10k

📊 Size Changes

No significant regressions detected 🎉. All bundle metrics remain identical to baseline.

🔍 Root Cause Analysis

  • No modules, packages, or assets were added, removed, or modified.

⚠️ Risk Assessment

Overall severity: Low

  • Zero delta in total size (5,861,069 bytes) and initial JS size (746,165 bytes) ensures no impact on load performance.

💡 Optimization Suggestions

  1. No action required based on this diff.
  2. Maintain current code-splitting strategy to keep initial chunk under 1 MB.
  3. Periodically audit dependencies to prevent future bloat creep.

Analysis by qwen3.5-plus

Generated by Rsdoctor GitHub Action

Base automatically changed from seal/concat-local-ident to main August 18, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant