fix: optimize concatenated module code generation hot paths#13375
fix: optimize concatenated module code generation hot paths#13375LingyuCoder merged 9 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Reduces ConcatenatedModule code generation overhead by optimizing name allocation and moving an expensive map teardown (module_to_info_map) off the hot path via background drop, with added unit tests to lock in identifier-splitting and name-conflict behavior.
Changes:
- Optimized
find_new_name(bothNameAllocatorand standalone) by reusing string buffers and avoiding repeated identifier-start checks/allocation. - Swapped out
module_to_info_mapand dropped the old map on a blocking thread usingfast_setto reduce critical-path teardown cost. - Added unit tests for
split_readable_identifierordering andfind_new_nameconflict-resolution stability.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 21.63KB from 48.70MB to 48.72MB (⬆️0.04%) |
Merging this PR will not alter performance
Comparing Footnotes
|
871cbaa to
1f70962
Compare
fffa8ba to
54750ea
Compare
Deploying rspack with
|
| Latest commit: |
54750ea
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c604c313.rspack-v2.pages.dev |
| Branch Preview URL: | https://codex-optimize-find-new-name.rspack-v2.pages.dev |
54750ea to
b67ec06
Compare
b67ec06 to
f3c4e43
Compare
|
📝 Benchmark detail: Open
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3c4e4394c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
ReplaceSourceinstances during final source assembly by movinginfo.sourceandchunk_init_fragmentsout ofmodule_to_info_mapConcatenatedModule-specific code generation hash fast path based on the precomputed module hash plus lightweight metadatamodule_to_info_map,NameAllocator,escaped_names,escaped_identifiers, andchangesafter they are no longer neededChecklist