Skip to content

feat: add persistent cache for module codegen#14731

Draft
ahabhgk wants to merge 7 commits into
mainfrom
codex/codegenerationresults
Draft

feat: add persistent cache for module codegen#14731
ahabhgk wants to merge 7 commits into
mainfrom
codex/codegenerationresults

Conversation

@ahabhgk

@ahabhgk ahabhgk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Related links

Checklist

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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 867abcc to feat: support fine-grained import.meta parser options (#14631) by AsyncIter

❌ Size increased by 129.00KB from 66.53MB to 66.66MB (⬆️0.19%)

@codspeed-hq

codspeed-hq Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 12.13%

❌ 2 regressed benchmarks
✅ 41 untouched benchmarks
⏩ 47 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@persistent_cache_restore_after_single_file_change@basic-react-development 4.9 ms 5.5 ms -12.19%
Simulation rust@persistent_cache_restore@basic-react-development 4.5 ms 5.1 ms -12.07%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/codegenerationresults (867abcc) with main (8ab773f)

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.

@ahabhgk ahabhgk force-pushed the codex/codegenerationresults branch from bb2b524 to 9bbce32 Compare July 10, 2026 07:39
@ahabhgk

ahabhgk commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 867abccd85

ℹ️ 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".

Comment thread crates/rspack_core/src/artifacts/code_generation_results.rs
Comment on lines +231 to 232
#[cacheable(with=AsOption<Unsupported>)]
pub concatenation_scope: Option<ConcatenationScope>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid poisoning codegen cache for concatenation scopes

Marking concatenation_scope as AsOption<Unsupported> makes serialization fail whenever it is Some. The ESM library concatenation-scope hook returns Some(ConcatenationScope) for scope-hoisted modules and parser/generator stores it on CodeGenerationResult, so ModulesCodegenOccasion::save will fail encoding and reset the entire modules-codegen occasion for those builds. This silently disables the new persistent codegen cache in that configuration; serialize the scope or skip only those entries instead of failing the whole artifact.

Useful? React with 👍 / 👎.

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