git clone --recurse-submodules https://github.com/ivanpovazan/coreclr-android-perf.git
cd ./coreclr-android-perf
To prepare environment to use nighlty builds run:
./prepare.shThe process creates ./versions.log which can be inspected to verify the installed versions of SDKs and workloads.
Note
Passing -f to the script resets the currently set environment.
To prepare environment to use preview 3 builds run:
./prepare.sh -f -userollbackNote
Passing -userollback updates the workloads to the version specified in rollback.json which is currently set to: 36.0.0-preview.3.20/10.0.100-preview.3 to ensure preview 3 builds.
To measure startup performance with XAPTR tool pass desired app for comparison:
./measure_startup.sh <dotnet-new-android|dotnet-new-maui|dotnet-new-maui-samplecontent>Note
Each app: <dotnet-new-android|dotnet-new-maui|dotnet-new-maui-samplecontent> has its own .conf file describing the exact configuration used for performance runs (e.g., dotnet-new-android.conf). Once measurements are completed the tool will output a report.md which can be inspected.
Note
XAPTR can be manually run with any custom .conf file via: ./build/xaptr -x some-custom-conf-file.conf
Once ./prepare.sh has been successfully executed you can also manually build/run template apps via ./build.sh <dotnet-new-android|dotnet-new-maui|dotnet-new-maui-samplecontent> <mono-coreclr> <build-run> <ntimes> [additional_args], where additional_args can be a list of MSBuild properties in which case surround the whole list with quotues (see example bellow).
For example:
- 
To build dotnet new androidsample with Mono in JIT configuration:./build.sh dotnet-new-android mono build 1 -p:_BuildConfig=JIT 
- 
To run dotnet new mauisample with CoreCLR in R2R configuration:./build.sh dotnet-new-maui coreclr run 1 "-p:_BuildConfig=R2R -p:AndroidEnableMarshalMethods=true"
Artifacts of manual builds are copied over to ./build folder where they can be further inspected. This is particularly useful for size inspections. Binlogs are also preserved.
Note
Directory.Build.props defines some common configuration options like based on _BuildConfig MSBuild property which can be used to run different predefined configs
In order to print information about previously built Android apps via ./build.sh run:
./print_apk_sizes.sh [-unzipped]By passing -unzipped it first unzipps the built apk and displays the information about it to the console.
- 
Checkout the repo: git clone --recurse-submodules https://github.com/ivanpovazan/coreclr-android-perf.git cd ./coreclr-android-perf
- 
Prepare environment: ./prepare.sh 
- 
Run startup measurements: ./measure_startup.sh dotnet-new-android Runs startup measurements with XAPTR and outputs the results in results.mdas reported in the console.
- 
Build time measurements: ./build.sh dotnet-new-android coreclr build 1 -p:_BuildConfig=JIT Runs the build and outputs the build time in the terminal, using CoreCLR and JIT configuration. The build artifacts end up in ./buildfolder. Increase the number of iterations as needed.
- 
Apk size measurements: ./print_apk_sizes.sh -unzipped Traverses ./buildfolder and prints out size of.apkfiles. E.g,:File: ./build/dotnet-new-android_20250408212750/bin/Release/net10.0-android/android-arm64/com.companyname.dotnet_new_android-Signed.apk, Size: 7420768 bytes Unpacked size of ./build/dotnet-new-android_20250408212750/bin/Release/net10.0-android/android-arm64/unpacked: 17512 KB 
In order to clean previous builds run:
./clean.sh <all|dotnet-new-android|dotnet-new-maui|dotnet-new-maui-samplecontent>Note
Passing all will clean builds of all apps.