Repository navigation
[TrimmableTypeMap] Skip redundant assembly reference scans - #12440
Merged
jonathanpeppers merged 1 commit intoAug 19, 2026
Merged
Conversation
Mark generated typemap publish items as known Mono.Android references so ProcessAssemblies does not reopen and scan every per-assembly typemap DLL. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves publish-time performance for trimmable TypeMap builds by preserving already-known assembly metadata instead of having ProcessAssemblies reopen and scan each generated TypeMap DLL to detect a Mono.Android reference.
Changes:
- Adds
HasMonoAndroidReference=truemetadata to generated trimmable TypeMap assemblies added toResolvedFileToPublish, avoiding redundant PE/metadata scans. - Applies the same metadata when swapping linked TypeMaps for ReadyToRun TypeMap outputs to keep the optimization consistent.
Show a summary per file
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets |
Marks generated/ReadyToRun TypeMap publish items with HasMonoAndroidReference=true so ProcessAssemblies can skip reopening and scanning these known Mono.Android-referencing assemblies. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
jonathanpeppers
approved these changes
Aug 19, 2026
jonathanpeppers
deleted the
dev/simonrozsival/skip-known-typemap-assembly-scans
branch
August 19, 2026 17:36
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Related: #10958
Summary
HasMonoAndroidReference=trueProcessAssembliesdetermines whether each publish assembly referencesMono.Android. When the item metadata is absent, it opens the DLL withPEReaderand scans its assembly-reference table. Trimmable Debug builds add approximately 82 generated typemap DLLs toResolvedFileToPublish; all of them are known to referenceMono.Android, making those file opens redundant.This issue and fix both exist independently on
main; no pregenerated framework typemap changes are required.Performance
Five clean MAUI Debug Android builds before and after the metadata change:
ProcessAssembliesA separate clean validation build from this
main-based branch measuredProcessAssembliesat 0.187s.Validation
Xamarin.Android.Build.Tasksdotnet new mauiDebug Android build with the trimmable typemapProcessAssembliescompleted in 0.187s