Skip to content

Commit

Permalink
[android] update .aotprofile for .NET 9 RC 2 (#25043)
Browse files Browse the repository at this point in the history
I recorded these with the `35.0.0-rc.2.145` Android workload as there
was one change that disables `$(AndroidEnableMarshalMethods)` that
impacts `.aotprofile` files:

* dotnet/android@afb5f7e

With this change in place, managed C# methods like these will reappear
in the profile:

    bool Android.Runtime.AndroidTypeManager:FastRegisterNativeMembers (Java.Interop.JniType,System.Type,System.ReadOnlySpan`1<char>)
    ...
    bool Android.Runtime.JNINativeWrapper:Wrap_JniMarshal_PPJ_Z (_JniMarshal_PPJ_Z,intptr,intptr,long)
    bool Android.Runtime.JNINativeWrapper:Wrap_JniMarshal_PPL_Z (_JniMarshal_PPL_Z,intptr,intptr,intptr)
    bool Android.Runtime.JNINativeWrapper:Wrap_JniMarshal_PPLLJ_Z (_JniMarshal_PPLLJ_Z,intptr,intptr,intptr,intptr,long)
    ...
    System.Delegate Android.App.Activity:GetOnActivityResult_IILandroid_content_Intent_Handler ()
    System.Delegate Android.App.Activity:GetOnBackPressedHandler ()

In the future, we hope to bring back `$(AndroidEnableMarshalMethods)`
once the known issues are worked out.

Measuring the new profile on a Pixel 7 Pro, an average of 10 runs of
the `dotnet new maui` project template:

    Before:
    Average(ms): 475.2
    Std Err(ms): 3.96316371938716
    Std Dev(ms): 12.5326240934078
    After:
    Average(ms): 447.1
    Std Err(ms): 1.75404294892305
    Std Dev(ms): 5.54677083235522

So, this change likely avoids some startup regression on Android, as
the C# methods that run on startup when
`AndroidEnableMarshalMethods=false` are now AOT-compiled.

I also added `-bl` to the `README.md`, as I thought that was useful.

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
  • Loading branch information
github-actions[bot] and jonathanpeppers authored Oct 2, 2024
1 parent 6e61993 commit 64129e3
Show file tree
Hide file tree
Showing 5 changed files with 323 additions and 273 deletions.
Binary file not shown.
Loading

0 comments on commit 64129e3

Please sign in to comment.