[net11.0] R2R-compile only System.Private.CoreLib for Debug CoreCLR mobile builds#25583
Open
kotlarmilos wants to merge 2 commits into
Open
[net11.0] R2R-compile only System.Private.CoreLib for Debug CoreCLR mobile builds#25583kotlarmilos wants to merge 2 commits into
kotlarmilos wants to merge 2 commits into
Conversation
…obile builds In Debug builds with CoreCLR on iOS, narrow _NonUserAssemblies to System.Private.CoreLib so that crossgen2 only ReadyToRun-compiles CoreLib and every other framework, MAUI, and NuGet assembly is excluded from R2R via the existing PublishReadyToRunExclude path. Non-R2R'd methods fall back to the CoreCLR interpreter at runtime (JIT is forbidden on iOS), which is the desired inner-loop behavior. Measured on SampleMAUI publish for ios-arm64 Debug: framework dylib drops from 318 MB to 28 MB and the .app bundle shrinks from 395 MB to 132 MB, with a corresponding reduction in crossgen2 time during build. Startup is unchanged in practice because the hot path through CoreLib is still R2R'd; only first-call cost for non-CoreLib methods shifts onto the interpreter, which is negligible for the inner-loop scenarios this default targets. Release builds are unaffected (FilterReadyToRunAssemblies already gates _SelectR2RAssemblies off for Release). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes Debug CoreCLR ReadyToRun filtering for macho builds so only System.Private.CoreLib is R2R-compiled, reducing Debug app size/build time while leaving other assemblies interpreted.
Changes:
- Narrows
_NonUserAssembliestoSystem.Private.CoreLib. - Routes all other assemblies through the existing
PublishReadyToRunExcludepath. - Keeps Release behavior unchanged through the existing
FilterReadyToRunAssembliesgating.
Show a summary per file
| File | Description |
|---|---|
dotnet/targets/Microsoft.Sdk.R2R.targets |
Updates the Debug CoreCLR R2R assembly selection filter to retain only CoreLib. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In Debug builds with CoreCLR on Apple mobile, narrow
_NonUserAssembliestoSystem.Private.CoreLibso that crossgen2 only ReadyToRun-compiles CoreLib and every other framework is excluded from R2R via the existingPublishReadyToRunExcludepath. Non-R2R'd methods fall back to the interpreter at runtime. The.appbundle shrinks from 395 MB to 132 MB, with a corresponding reduction in crossgen2 time during build. Startup is unchanged in practice because the hot path through corelib is still R2R.