Skip to content

perf(core): optimize module rendering for chunk assets - #15394

Open
LingyuCoder wants to merge 1 commit into
mainfrom
seal/optimize-create-chunk-assets
Open

perf(core): optimize module rendering for chunk assets#15394
LingyuCoder wants to merge 1 commit into
mainfrom
seal/optimize-create-chunk-assets

Conversation

@LingyuCoder

Copy link
Copy Markdown
Contributor

Summary

  • reuse the rendered module runtime scope across modules in the same chunk
  • build module factory arguments directly instead of allocating and joining temporary strings
  • avoid cloning chunk init fragments and preallocate module result containers
  • reuse module identifiers across rendering lookups

Performance

Measured with the React 10k production fixture in Docker using targeted Valgrind Callgrind instrumentation:

  • targeted instruction count: 43,894,917 -> 19,396,556 (-55.81%)
  • create chunk assets stage median: 10.068 ms -> 9.463 ms (-6.00%)
  • all 19 emitted files remained byte-for-byte identical to the baseline

Related links

N/A

Checklist

  • Tests updated (not required for behavior-preserving refactoring).
  • Documentation updated (not required).

Validation

  • cargo fmt --all --check
  • cargo check -p rspack_plugin_javascript -p rspack_plugin_esm_library
  • pnpm run build:binding:dev
  • pnpm run test:unit

@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-29T18:07:03.688646Z 9435e69 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 9435e69 to chore(deps): update dependency @module-federation/runtime-tools to v2.9.0 (#15386) by renovate[bot]

🙈 Size remains the same at 68.30MB

@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-1k 823.1 KB 218.4 KB 0 0
react-10k 5.6 MB 1.3 MB 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 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 50 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing seal/optimize-create-chunk-assets (9435e69) 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.

@LingyuCoder LingyuCoder changed the title refactor(core): optimize module rendering for chunk assets perf(core): optimize module rendering for chunk assets Aug 30, 2026
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