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
Fixes: dotnet#6053
This is still WIP. Still a few pieces missing on the dotnet/runtime to
enable this:
dotnet/runtime#56989
We will need a `libmono-profiler-aot.so` from dotnet/runtime to be
able to record AOT profiles.
For now, I could:
1. Use the `startup.aotprofile` we're already shipping in "legacy"
Xamarin.Android.
2. Pass this in when `$(AndroidEnableProfiledAot)` is `true`.
~~ Results ~~
All tests:
1. Were running on a [Google Pixel 5][0], and
2. Enabled two architectures, arm64 and x86, and
3. **AOT time** was average of 10 runs with `-c Release
-p:RunAOTCompilation=true`, with the`Activity: Displayed` time
4. **Profiled AOT time** was average of 10 runs with `-c Release
-p:RunAOTCompilation=true -p:AndroidEnableProfiledAot=true` with
the `Activity: Displayed` time.
| Test | AOT time | Profiled AOT time | AOT apk size | Profiled AOT apk size |
| ------------------- | ------------: | ----------------: | ------------: | --------------------: |
| [HelloAndroid][1] | 00:00:00.246 | 00:00:00.288 | 12,151,755 | 9,161,675 |
| [HelloMaui][2] | 00:00:00.619 | 00:00:01.131 | 43,442,233 | 19,992,633 |
From these results, we see that Profiled AOT is AOT'ing *some* of the
assemblies.
We are not getting the best startup time yet, because some methods are
still using the JIT:
08-06 14:12:34.985 30817 30817 D Mono : AOT: FOUND method Android.Runtime.JNIEnv:NewGlobalRef (intptr) [0x7ae3c8c620 - 0x7ae3c8c6a0 0x7ae3c9849c]
08-06 14:12:34.985 30817 30817 D Mono : AOT: NOT FOUND: intptr:op_Explicit (intptr).
08-06 14:12:34.985 30817 30817 D Mono : AOT: NOT FOUND: intptr:op_Explicit (int).
08-06 14:12:34.986 30817 30817 D Mono : AOT: FOUND method System.WeakReference`1:.ctor (T,bool) [0x7ae3d8c580 - 0x7ae3d8c5d0 0x7ae3ddaec1]
08-06 14:12:34.986 30817 30817 D Mono : AOT: FOUND method System.WeakReference`1:Create (T,bool) [0x7ae3d8c4c0 - 0x7ae3d8c580 0x7ae3ddaebd]
08-06 14:12:34.986 30817 30817 D Mono : AOT: NOT FOUND: System.Runtime.InteropServices.GCHandle:Alloc (object,System.Runtime.InteropServices.GCHandleType).
08-06 14:12:34.986 30817 30817 D Mono : AOT: NOT FOUND: System.Runtime.InteropServices.GCHandle:Alloc (object,System.Runtime.InteropServices.GCHandleType).
08-06 14:12:34.986 30817 30817 D Mono : AOT: NOT FOUND: System.Runtime.InteropServices.GCHandle:.ctor (object,System.Runtime.InteropServices.GCHandleType).
Overall, seems promising, though.
[0]: store.google.com/us/product/pixel_5_specs?hl=en-US
[1]: dotnet/maui-samples@7144604/HelloAndroid
[2]: dotnet/maui-samples@7144604/HelloMaui
0 commit comments