You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks progress on updating the Xamarin.iOS build to support deduplication of generics in the native code during AOT compilation. When Mono AOT compiler encounters a generic instance that is not handled by generic sharing, it will emit a code for the instance. If the same instance is encountered during AOT compilation in multiple assemblies, the code will be emitted multiple times, increasing code size.
Tasks
Generate an empty assembly prior _AOTCompile target
Update Xamarin.iOS build to pass dedup-skip to AOT compiler
Update Xamarin.iOS build to pass the generated assembly along with other assemblies with dedup-include to AOT compiler
Test the update on MySingleView and MonoTouch tests
This PR contributes to dotnet/runtime#83193. It
creates a new target `_CreateAOTDedupAssembly`, and makes the `_AOTCompile`
depend on it. Also, it changes the `AOTCompile` task to pass `dedup-skip` and
`dedup-include` to the Mono AOT compiler.
The change was tested on `MySingleView` app and `Monotouch` tests. Both apps
are working, but some monotouch tests are failing due to
`Arg_NotlmplementedException`. Assumption is that calls between Obj-C and C#
could be problematic, as with the dedup improvement enabled, extra methods got
moved from origin assemblies to the dedup assembly, so native to managed
mapping could be corrupted.
Here are preliminary results comparing size on disk and build time between the
baseline (`net8.0` branch) and the target (this branch). Binlog details are
[attached](https://github.com/xamarin/xamarin-macios/files/10942772/binlog.zip).
| App | Baseline size on disk .ipa (MB) | Target size on disk .ipa (MB) | Baseline size on disk .app (MB) | Target size on disk .app (MB) | Baseline build time (s) | Target build time (s) | .app diff (%) |
| ---------------------------------------- | ------------------------------- | ----------------------------- | ------------------------------- | ----------------------------- | ----------------------- | --------------------- | ------------- |
| MySingleView Release iOS | 5,40 | 5,40 | 29,2 | 15,20 | 29,18 | 16,77 | 47,94 |
| MySingleView Release iOSSimulator-arm64 | N/A | N/A | 469,5 | 341,80 | 468,00 | 330,00 | 27,20 |
| Monotouch Release llvm iOS | 49,00 | 38,80 | 209,60 | 157,40 | 115,00 | 130,00 | 24,90 |
Draft PR should get a full test run on the changes. The following tasks should
be resolved before making this PR ready for review.
Description
This issue tracks progress on updating the
Xamarin.iOS
build to support deduplication of generics in the native code during AOT compilation. When Mono AOT compiler encounters a generic instance that is not handled by generic sharing, it will emit a code for the instance. If the same instance is encountered during AOT compilation in multiple assemblies, the code will be emitted multiple times, increasing code size.Tasks
_AOTCompile
targetXamarin.iOS
build to passdedup-skip
to AOT compilerXamarin.iOS
build to pass the generated assembly along with other assemblies withdedup-include
to AOT compilerRelated issues are #80419 and mono/mono#6965.
The text was updated successfully, but these errors were encountered: