Skip to content

perf(core): optimize create module hashes - #15396

Open
LingyuCoder wants to merge 1 commit into
mainfrom
seal/optimize-create-module-hashes
Open

perf(core): optimize create module hashes#15396
LingyuCoder wants to merge 1 commit into
mainfrom
seal/optimize-create-module-hashes

Conversation

@LingyuCoder

Copy link
Copy Markdown
Contributor

Summary

  • avoid constructing a temporary RuntimeSpec when filtering a singleton runtime
  • lazily allocate the exports-info cycle-detection set only when nested exports are traversed
  • keep concatenated module hash inputs as RspackHashDigest values instead of converting them to owned strings
  • preserve generated output while reducing allocation and hashing overhead in create module hashes

Callgrind measurement on the React 10k production fixture without minification reduced the create module hashes stage from 705,923,691 IR to 557,307,083 IR, a 21.05% reduction. The baseline and optimized builds produced byte-identical output across all 19 emitted files.

Related links

N/A

Verification

  • cargo fmt --all -- --check
  • pnpm run build:binding:dev
  • pnpm run test:unit
  • byte-for-byte comparison of the React 10k production output

Checklist

  • Tests updated (not required; existing unit coverage and output comparison verify the behavior).
  • Documentation updated (not required; no user-facing behavior changes).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 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-30T07:24:29.434945Z 90f2db7 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 90f2db7 to perf(ids): optimize deterministic module id assignment (#15393) by harpsealjs

❌ Size increased by 4.00KB from 68.30MB to 68.30MB (⬆️0.01%)

@github-actions

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

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-1k 823.1 KB 218.4 KB 0 0
react-5k 2.7 MB 669.3 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@codspeed-hq

codspeed-hq Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 14.91%

⚠️ 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_hashes 8.4 ms 7.3 ms +14.91%

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/optimize-create-module-hashes (90f2db7) with main (f281cc9)

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.

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