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

[Xamarin.Android.Build.Tasks] Add PerformanceTimer for measuring task steps time. #9555

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Nov 25, 2024

Running an MSBuild task in a profiler is extremely hard, so for now I've been resorting to "printf" profiling. This adds a utility class that makes it easier to add performance information to the steps in a task. The output ends up in a .binlog.
 
Example output (MAUI template release build):

- BuildApk.RunTask - 13597ms
  - Setup - 0ms
  - Compression - 0ms
  - DSOWrapperGenerator - 0ms
  - ExecuteWithAbi 'arm64-v8a, x86_64' - 13591ms
    - Setup - 24ms
    - Add DalvikClasses - 1933ms
    - Embed Assemblies - 5120ms
      - Add 156 user assemblies - 2420ms
      - Add 80 framework assemblies - 1739ms
      - Generate assembly store - 42ms
      - Add assembly store - 918ms
    - AddRuntimeConfigBlob - 197ms
    - AddRuntimeLibraries - 21ms
    - Flush - 169ms
    - AddNativeLibraries - 829ms
    - AddAdditionalNativeLibraries - 0ms
    - Add files - 42ms
    - Add Jars - 515ms
    - Clean up Removed files - 0ms
    - Flush - 4640ms
    - FixupArchive - 93ms
  - Cleanup - 2ms

This is roughly what I used to profile the GenerateJavaStubs task (#9208, #9215) and I am now starting to look and see if there are any performance wins in BuildApk. I use this locally, the team can decide if we want to commit this to the repo or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant