-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[android] add projects to record AOT profiles #4859
Conversation
In-tree tests are failing... because I moved the |
1c0de5d
to
8da1947
Compare
Context: https://github.com/jonathanpeppers/Mono.Profiler.Android#usage-of-the-aot-profiler Adds projects and instructions for creating AOT profiles for Android. Additionally, add a new profile for `maui-blazor` to be used when `$(UsingMicrosoftNETSdkRazor)` is `true`. `CommonMethods.cs` has various APIs that we want to include in the built-in AOT profile. Right now, it most importantly includes usage of `HttpClient` and `System.Threading.Tasks`. `maui.aotprofile.txt` is an alphabetical list of methods in the profile. We can track changes to this file over time. ~~ Results ~~ `dotnet new maui` on a Pixel 5: 02-23 09:48:40.822 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +470ms 02-23 09:48:42.056 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +485ms 02-23 09:48:43.262 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +465ms 02-23 09:48:44.438 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +471ms 02-23 09:48:45.667 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +473ms 02-23 09:48:46.909 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +458ms 02-23 09:48:48.100 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +462ms 02-23 09:48:49.312 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +463ms 02-23 09:48:50.538 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +461ms 02-23 09:48:51.719 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +465ms Average(ms): 467.3 Std Err(ms): 2.47229088543849 Std Dev(ms): 7.81807023646003 Same project using MAUI Preview 13 was `Average(ms): 490.9`. `dotnet new maui-blazor`: 02-23 09:51:23.245 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +570ms 02-23 09:51:24.480 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +595ms 02-23 09:51:25.656 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +574ms 02-23 09:51:26.870 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +577ms 02-23 09:51:28.078 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +584ms 02-23 09:51:29.243 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +556ms 02-23 09:51:30.457 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +570ms 02-23 09:51:31.699 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +596ms 02-23 09:51:32.896 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +578ms 02-23 09:51:34.117 1802 1962 I ActivityTaskManager: Displayed com.companyname.foo/crc64808a40cc7e533249.MainActivity: +578ms Average(ms): 577.8 Std Err(ms): 3.76769897358528 Std Dev(ms): 11.9145102944081 Same project using MAUI Preview 13 was `Average(ms): 664.0`.
8da1947
to
573706a
Compare
<Exec Command=""$(DotNetToolPath)" new $(App) -o $(Intermediate)" EnvironmentVariables="$(EnvVars)" /> | ||
<!-- MainPage.xaml.cs uses CommonMethod.cs --> | ||
<Copy SourceFiles="src/MainPage-$(App).cs" DestinationFiles="$(Intermediate)MainPage.xaml.cs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now invokes the template and copies one file over top. So a lot less code now.
src/ProfiledAot/README.md
Outdated
$ ./bin/dotnet/dotnet build src/ProfiledAot/build.proj -p:App=maui | ||
$ ./bin/dotnet/dotnet build src/ProfiledAot/build.proj -p:App=maui-blazor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instructions have changed now as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one minor formatting issue in the README.
Context: https://github.com/jonathanpeppers/Mono.Profiler.Android#usage-of-the-aot-profiler
Adds projects and instructions for creating AOT profiles for Android.
Additionally, add a new profile for
maui-blazor
to be used when$(UsingMicrosoftNETSdkRazor)
istrue
.CommonMethods.cs
has various APIs that we want to include in thebuilt-in AOT profile. Right now, it most importantly includes usage of
HttpClient
andSystem.Threading.Tasks
.maui.aotprofile.txt
is an alphabetical list of methods in theprofile. We can track changes to this file over time.
Results
dotnet new maui
on a Pixel 5:Same project using MAUI Preview 13 was
Average(ms): 490.9
.dotnet new maui-blazor
:Same project using MAUI Preview 13 was
Average(ms): 664.0
.PR Checklist
Does this PR touch anything that might affect accessibility?
No