Skip to content

davidnguyen-tech/coreclr-android-perf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions

Cloning the repo

git clone --recurse-submodules https://github.com/ivanpovazan/coreclr-android-perf.git
cd ./coreclr-android-perf

Setting up the environment

Using latest nightly builds

To prepare environment to use nighlty builds run:

./prepare.sh

The 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.

Using 10.0.100-preview.3 builds

To prepare environment to use preview 3 builds run:

./prepare.sh -f -userollback

Note

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.

Performance measurments

Measuring startup with XAPTR

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

Building / running sample apps manually

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 android sample with Mono in JIT configuration:

    ./build.sh dotnet-new-android mono build 1 -p:_BuildConfig=JIT
  • To run dotnet new maui sample 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

WIP: Measuring Apk sizes

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.

Typical worklfow

  1. Checkout the repo:

    git clone --recurse-submodules https://github.com/ivanpovazan/coreclr-android-perf.git
    cd ./coreclr-android-perf
  2. Prepare environment:

    ./prepare.sh
  3. Run startup measurements:

    ./measure_startup.sh dotnet-new-android

    Runs startup measurements with XAPTR and outputs the results in results.md as reported in the console.

  4. 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 ./build folder. Increase the number of iterations as needed.

  5. Apk size measurements:

    ./print_apk_sizes.sh -unzipped

    Traverses ./build folder and prints out size of .apk files. 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

Cleaning the builds

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.4%
  • Shell 1.6%