Skip to content

perf(ids): optimize deterministic module id assignment - #15393

Merged
LingyuCoder merged 1 commit into
mainfrom
seal/profile-create-hash-react10k
Aug 30, 2026
Merged

perf(ids): optimize deterministic module id assignment#15393
LingyuCoder merged 1 commit into
mainfrom
seal/profile-create-hash-react10k

Conversation

@LingyuCoder

Copy link
Copy Markdown
Contributor

Summary

  • precompute the webpack-compatible FNV prefix state in the existing parallel full-module-name pass
  • cache module pre-order indices before sorting instead of looking them up from the module graph in every comparison
  • reserve the module ID collections and materialize each numeric ModuleId only once
  • preserve the existing range selection, UTF-16 hashing, salt, collision retry, and deterministic ordering behavior

On the React 10k production fixture with a warm persistent cache:

  • DeterministicModuleIdsPlugin: 11.905 ms -> 6.490 ms median (45.5% reduction)
  • complete module ids pass: 12.340 ms -> 7.646 ms median (38.0% reduction)
  • all 19 cold-build output file names and SHA-256 hashes are unchanged

Related links

N/A

Testing

  • cargo test -p rspack_util number_hash
  • cargo check -p rspack_util -p rspack_ids
  • pnpm run build:binding:dev
  • pnpm run test:unit (9158 passed, 4 skipped; CLI 90 passed, 1 skipped)

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T15:29:53.609125Z 0dd4dcf PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 0dd4dcf to chore(deps): update dependency @module-federation/runtime-tools to v2.9.0 (#15386) by renovate[bot]

🎉 Size decreased by 4.00KB from 68.30MB to 68.30MB (⬇️0.01%)

@codspeed-hq

codspeed-hq Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 49.28%

⚠️ 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
✅ 49 untouched benchmarks
⏩ 47 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@create_module_ids 4.9 ms 3.3 ms +49.28%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing seal/profile-create-hash-react10k (0dd4dcf) with main (a68bb1e)

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

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

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

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 556.5 KB 0 0
react-10k 5.6 MB 1.3 MB 0 0
react-5k 2.7 MB 669.3 KB 0 0
react-1k 823.1 KB 218.4 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@LingyuCoder LingyuCoder changed the title refactor(ids): optimize deterministic module id assignment perf(ids): optimize deterministic module id assignment Aug 29, 2026

@chenjiahan chenjiahan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LingyuCoder
LingyuCoder merged commit f281cc9 into main Aug 30, 2026
45 checks passed
@LingyuCoder
LingyuCoder deleted the seal/profile-create-hash-react10k branch August 30, 2026 05:16
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.

2 participants