Skip to content

perf: use numeric suffixes for faster concatenation - #15228

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

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

Conversation

@LingyuCoder

@LingyuCoder LingyuCoder commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

This is an experimental follow-up to #14852 for measuring a smaller naming optimization against the indexed-name approach in #15222.

  • Keep the existing NameAllocator and find_new_name collision handling.
  • Skip readable-identifier lookup and splitting only when faster module concatenation is enabled, so conflicts use numeric suffixes such as foo_0.
  • Preserve the legacy module-concatenation naming path unchanged when the experiment is disabled.

Related links

Validation

  • cargo check -p rspack_core
  • pnpm --filter @rspack/tests test FasterModuleConcatenation.test.js (84 passed)
  • Two Callgrind runs produced the same 77,932,283 instruction count

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 5e6ff53 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 244.00KB from 68.20MB to 68.44MB (⬆️0.35%)

@github-actions

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

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 - -
react-1k 823.1 KB 218.4 KB - -
react-10k 5.6 MB 1.3 MB - -
react-5k 2.7 MB 669.3 KB - -
ui-components 4.9 MB 1.4 MB - -
📋 Detailed Reports (Click to expand)

📁 popular-libs

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

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

Metric Current Baseline Change
📊 Total Size 1.7 MB - -
🗜️ Gzip Size 556.7 KB - -
📄 JavaScript 1.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 289.0 B - -
📁 Other Assets 0 B - -

📁 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-10k

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

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

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

📁 react-5k

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

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

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

📁 ui-components

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

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

Metric Current Baseline Change
📊 Total Size 4.9 MB - -
🗜️ Gzip Size 1.4 MB - -
📄 JavaScript 4.8 MB - -
🎨 CSS 112.5 KB - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@codspeed

codspeed Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 25.06%

⚠️ 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

⚡ 1 improved benchmark
✅ 48 untouched benchmarks
⏩ 47 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@concatenate_module_code_generation 33.7 ms 26.9 ms +25.06%

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-numeric-suffix (5e6ff53) 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.

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