Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

<ItemGroup Condition="'$(AndroidEnableProfiledAot)' == 'true' and '$(MauiUseDefaultAotProfile)' != 'false'">
<AndroidAotProfile Include="$(MSBuildThisFileDirectory)maui.aotprofile" />
<AndroidAotProfile Include="$(MSBuildThisFileDirectory)maui-sc.aotprofile" />
<AndroidAotProfile Include="$(MSBuildThisFileDirectory)maui-blazor.aotprofile" />
</ItemGroup>

Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions src/ProfiledAot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ https://github.com/jonathanpeppers/Mono.Profiler.Android#usage-of-the-aot-profil
Build MAUI following the instructions at [DEVELOPMENT.md][0]. Make
sure to build with `--configuration=Release`.

Run the `Record` target on each project:
Run the `Record` target on each "type" of project template:

```bash
$ ./bin/dotnet/dotnet build src/ProfiledAot/build.proj -bl -p:App=maui
$ ./bin/dotnet/dotnet build src/ProfiledAot/build.proj -bl -p:App=maui-blazor
./.dotnet/dotnet build src/ProfiledAot/build.proj -bl -p:App=maui
./.dotnet/dotnet build src/ProfiledAot/build.proj -bl -p:App=maui-sc
./.dotnet/dotnet build src/ProfiledAot/build.proj -bl -p:App=maui-blazor
```

* `maui` is `dotnet new maui`
* `maui-sc` is `dotnet new maui -sc` or (sample content)
* `maui-blazor` is `dotnet new maui-blazor`

You can also use `-r android-x64`, if you'd prefer an x86_64 emulator.

`maui.aotprofile.txt` and `maui-blazor.aotprofile.txt` are a list of
Expand All @@ -37,9 +42,9 @@ Build MAUI again with `--configuration=Release` (see
Create a new project and run it:

```bash
$ mkdir foo && cd foo
$ ../bin/dotnet/dotnet new maui
$ ../bin/dotnet/dotnet build -c Release -t:Run -f net7.0-android
mkdir foo && cd foo
../.dotnet/dotnet new maui
../.dotnet/dotnet build -c Release -t:Run -f net7.0-android
```

Run the app a few times and make sure you get good launch times:
Expand Down Expand Up @@ -75,8 +80,8 @@ rm -r ~\.nuget\packages\*\*-dev\
To verify what methods are AOT'd, clear the log and enable AOT logging:

```bash
$ adb logcat -c
$ adb shell setprop debug.mono.log default,timing=bare,assembly,mono_log_level=debug,mono_log_mask=aot
adb logcat -c
adb shell setprop debug.mono.log default,timing=bare,assembly,mono_log_level=debug,mono_log_mask=aot
```

Restart the app, and you should be able to see messages like:
Expand Down
11 changes: 9 additions & 2 deletions src/ProfiledAot/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
<EnvVars>DOTNET_MULTILEVEL_LOOKUP=0</EnvVars>
</PropertyGroup>
<Target Name="Record">
<Error Condition=" '$(App)' != 'maui' and '$(App)' != 'maui-blazor' " Text="Please pass -p:App=maui or -p:App=maui-blazor" />
<Error Condition=" '$(App)' != 'maui' and '$(App)' != 'maui-sc' and '$(App)' != 'maui-blazor' " Text="Please pass -p:App=maui, -p:App=maui-sc, or -p:App=maui-blazor" />
<RemoveDir Directories="$(Intermediate)" />
<Exec Command="&quot;$(DotNetToolPath)&quot; new $(App) -o $(Intermediate)" EnvironmentVariables="$(EnvVars)" />
<PropertyGroup Condition=" '$(App)' != 'maui-sc' ">
<_TemplateName>$(App)</_TemplateName>
</PropertyGroup>
<PropertyGroup Condition=" '$(App)' == 'maui-sc' ">
<_TemplateName>maui</_TemplateName>
<_TemplateParameters>-sc</_TemplateParameters>
</PropertyGroup>
<Exec Command="&quot;$(DotNetToolPath)&quot; new $(_TemplateName) $(_TemplateParameters) -o $(Intermediate)" EnvironmentVariables="$(EnvVars)" />
<!-- Copy replacement files-->
<ItemGroup>
<_FilesToCopy Include="src/$(App)/*" />
Expand Down
Loading