Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0.1xx-rc2] [android] update .aotprofile for .NET 9 RC 2 #25043

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 1, 2024

Backport of #25035 to release/9.0.1xx-rc2

/cc @rmarinho @jonathanpeppers

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.
@github-actions github-actions bot requested a review from a team as a code owner October 1, 2024 21:51
@github-actions github-actions bot requested review from jsuarezruiz and tj-devel709 and removed request for a team October 1, 2024 21:51
@rmarinho rmarinho merged commit 64129e3 into release/9.0.1xx-rc2 Oct 2, 2024
2 of 4 checks passed
@rmarinho rmarinho deleted the backport/pr-25035-to-release/9.0.1xx-rc2 branch October 2, 2024 11:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants