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

Build Performance and App Size #22

Closed
akamud opened this issue Aug 25, 2019 · 1 comment
Closed

Build Performance and App Size #22

akamud opened this issue Aug 25, 2019 · 1 comment

Comments

@akamud
Copy link

@akamud akamud commented Aug 25, 2019

Build Performance (No bin/obj - NO AOT)

  • Before Cold Build Times Changes:
Time Elapsed 00:00:21.30
  • After Cold Build Times Changes:
Time Elapsed 00:00:20.28

Build Performance (Incremental change - NO AOT)

  • Before Incremental Build Times Changes:
Time Elapsed 00:00:07.24
  • After Incremental Build Times Changes:
Time Elapsed 00:00:04.49

Application Size (Download Size - NO AOT)

  • Before Application Size Changes:
App download size: 13MB
APK Size: 27.3MB
  • After Application Size Changes:
RAW Size: 13.1MB

Bonus (Build Perf Summary Log)

This build is from one of the clean build perf runs (after the adjustements), which had similar result (18s)

Done building project "myapp.myapp.Droid.csproj".

Project Evaluation Performance Summary:
       55 ms  /Users/mahmoud/Repo/my-app-myapp-mobile/src/myapp.myapp.Core/myapp.myapp.Core.csproj   1 calls

Project Performance Summary:
      228 ms  /Users/mahmoud/Repo/my-app-myapp-mobile/src/myapp.myapp.Core/myapp.myapp.Core.csproj   5 calls
    17635 ms  /Users/mahmoud/Repo/my-app-myapp-mobile/src/myapp.myapp.Droid/myapp.myapp.Droid.csproj   1 calls

Target Performance Summary:
        * ms  GetCopyToOutputDirectoryItems              2 calls
        0 ms  GenerateAssemblyInfo                       1 calls
        0 ms  _SetLatestTargetFrameworkVersion           1 calls
        0 ms  UpdateGeneratedFiles                       1 calls
        0 ms  _AddAndroidDefines                         1 calls
        0 ms  UpdateAndroidResources                     1 calls
        0 ms  ResolvePackageDependenciesForBuild         1 calls
        0 ms  _GenerateEnvironmentFiles                  1 calls
        0 ms  InitializeSourceControlInformation         1 calls
        0 ms  AddSourceRevisionToInformationalVersion    1 calls
        0 ms  UpdateAndroidAssets                        1 calls
        0 ms  _UpdateAndroidResources                    1 calls
        0 ms  _SetupDesignTimeBuildForBuild              1 calls
        0 ms  ResolveLockFileAnalyzers                   1 calls
        0 ms  EnableIntermediateOutputPathMismatchWarning   1 calls
        0 ms  IncludeTransitiveProjectReferences         1 calls
        0 ms  _SetupDesignTimeBuildForIntellisense       1 calls
        0 ms  BeforeResGen                               2 calls
        0 ms  PrepareResources                           2 calls
        0 ms  PrepareResourceNames                       2 calls
        0 ms  _DefaultMicrosoftNETPlatformLibrary        1 calls
        0 ms  BeforeCompile                              2 calls
        0 ms  SetWin32ManifestProperties                 2 calls
        0 ms  BeforeResolveReferences                    2 calls
        0 ms  AfterBuild                                 2 calls
        0 ms  AfterResGen                                2 calls
        0 ms  CreateCustomManifestResourceNames          2 calls
        0 ms  GetFrameworkPaths                          2 calls
        0 ms  CoreBuild                                  2 calls
        0 ms  PrepareForRun                              2 calls
        0 ms  _CopySourceItemsToOutputDirectory          2 calls
        0 ms  GenerateManifests                          2 calls
        0 ms  CreateSatelliteAssemblies                  2 calls
        0 ms  AfterResolveReferences                     2 calls
        0 ms  _CheckTargetFramework                      1 calls
        0 ms  BeforeBuild                                2 calls
        0 ms  _IncludeLayoutBindingSources               1 calls
        0 ms  Compile                                    2 calls
        0 ms  ComputeIntermediateSatelliteAssemblies     1 calls
        0 ms  _CheckForContent                           1 calls
        0 ms  IncludeProguardForAndroid                  1 calls
        0 ms  _LinkAssemblies                            1 calls
        0 ms  AfterCompile                               2 calls
        0 ms  _CheckForUnsupportedNETStandardVersion     1 calls
        0 ms  _XamarinAndroidSupportVectorDrawableArgs   1 calls
        0 ms  _CollectPlatformJarFilenamesFastDev        1 calls
        0 ms  _CheckForObsoleteDotNetCliToolReferences   1 calls
        0 ms  _IncludeInstanceRunReference               1 calls
        0 ms  Build                                      2 calls
        0 ms  _GetProjectJsonPath                        1 calls
        0 ms  _CollectRuntimeJarFilenames                1 calls
        0 ms  _CheckSupportedAbis                        1 calls
        0 ms  _BeforeCleanIntermediateIfNuGetsChange     1 calls
        0 ms  ResGen                                     2 calls
        0 ms  _BeforeVBCSCoreCompile                     2 calls
        0 ms  _ValidateMSBuild                           2 calls
        0 ms  BuildOnlySettings                          2 calls
        0 ms  _AddMultiDexDependencyJars                 1 calls
        0 ms  GetTargetPath                              3 calls
        0 ms  PrepareProjectReferences                   2 calls
        0 ms  ValidateTargetFrameworkVersionForForms     1 calls
        0 ms  ResolveNativeReferences                    2 calls
        0 ms  _SeparateAppExtensionReferences            1 calls
        0 ms  ExpandSDKReferences                        2 calls
        0 ms  _GetRestoreProjectStyle                    1 calls
        0 ms  _ValidateLinkMode                          1 calls
        0 ms  _GenerateLayoutBindings                    1 calls
        0 ms  _ReadAapt2VersionCache                     1 calls
        0 ms  _CompileFastDevDex                         1 calls
        0 ms  _CheckForObsoleteAssemblies                1 calls
        0 ms  _GetReferenceAssemblyPaths                 1 calls
        0 ms  ResolveSDKReferences                       2 calls
        0 ms  _SetupInstantRun                           1 calls
        0 ms  _ValidateXFTasks                           2 calls
        0 ms  CssG                                       4 calls
        0 ms  FodyTarget                                 1 calls
        0 ms  _CheckForDeletedResourceFile               1 calls
        0 ms  GetNativeManifest                          1 calls
        0 ms  _SetTargetFrameworkMonikerAttribute        2 calls
        0 ms  _PrepareEnvironmentAssemblySources         1 calls
        0 ms  GetTargetFrameworks                        1 calls
        0 ms  GetAssemblyAttributes                      1 calls
        0 ms  _CopyConfigFiles                           1 calls
        0 ms  CollectPackageReferences                   1 calls
        0 ms  _ValidateResourceCache                     1 calls
        0 ms  _FindCSSFiles                              2 calls
        0 ms  _SetupDesignTimeBuildForCompile            1 calls
        0 ms  _DefineBuildTargetAbis                     1 calls
        0 ms  _CheckForCompileOutputs                    2 calls
        0 ms  _CalculateAdditionalResourceCacheDirectories   1 calls
        0 ms  _AddFilesToFileWrites                      1 calls
        0 ms  _ConvertPdbFiles                           1 calls
        0 ms  _ResolveXamarinAndroidTools                1 calls
        0 ms  _CollectTargetFrameworkForTelemetry        1 calls
        0 ms  CoreGenerateAssemblyInfo                   1 calls
        0 ms  RunProduceContentAssets                    1 calls
        0 ms  _CheckInstantRunCondition                  1 calls
        0 ms  _CompileDex                                1 calls
        1 ms  VectorDrawableCheckBuildToolsVersionTask   1 calls
        1 ms  GetTargetPathWithTargetPlatformMoniker     3 calls
        1 ms  _CreateAdditionalResourceCache             4 calls
        1 ms  GetAssemblyVersion                         1 calls
        1 ms  _SplitProjectReferencesByFileExistence     3 calls
        1 ms  _CheckProjectItems                         1 calls
        1 ms  _CreatePackageWorkspace                    1 calls
        1 ms  _ComputeAndroidAssetsPaths                 1 calls
        1 ms  _GetAdditionalResourcesFromAssemblies      1 calls
        1 ms  _GenerateCompileInputs                     2 calls
        1 ms  CreateGeneratedAssemblyInfoInputsCacheFile   1 calls
        1 ms  _CheckDuplicateJavaLibraries               1 calls
        1 ms  PrepareForBuild                            2 calls
        1 ms  _CreateAapt2VersionCache                   1 calls
        1 ms  XamlG                                      3 calls
        1 ms  _FindXamlGFiles                            2 calls
        1 ms  _ComputeReferenceAssemblies                1 calls
        1 ms  AssignProjectConfiguration                 2 calls
        1 ms  GetReferenceAssemblyPaths                  2 calls
        1 ms  GenerateTargetFrameworkMonikerAttribute    2 calls
        1 ms  _FindLayoutsForBinding                     1 calls
        1 ms  _CreatePropertiesCache                     1 calls
        1 ms  GenerateBuildDependencyFile                1 calls
        1 ms  _GetMonoPlatformJarPath                    1 calls
        1 ms  ResolveReferences                          2 calls
        1 ms  _CleanIntermediateIfNuGetsChange           1 calls
        1 ms  CreateManifestResourceNames                1 calls
        1 ms  _IncludeNativeSystemLibraries              1 calls
        2 ms  _DetectIfAppWasUninstalled                 1 calls
        2 ms  _GetLibraryImports                         1 calls
        2 ms  _ExtractLibraryProjectImports              1 calls
        2 ms  ResolveLockFileReferences                  1 calls
        2 ms  _CollectMonoAndroidOutputs                 1 calls
        2 ms  _ReadAndroidManifest                       1 calls
        2 ms  _ValidateAndroidPackageProperties          1 calls
        2 ms  ApplyImplicitVersions                      1 calls
        2 ms  _AdjustJavacVersionArguments               1 calls
        2 ms  CheckForDuplicateItems                     1 calls
        2 ms  _PrepareNativeAssemblySources              1 calls
        2 ms  CoreResGen                                 2 calls
        2 ms  _CheckForInvalidConfigurationAndPlatform   2 calls
        2 ms  ResolvePackageAssets                       1 calls
        3 ms  CheckForImplicitPackageReferenceOverrides   1 calls
        3 ms  SplitResourcesByCulture                    2 calls
        3 ms  AssignLinkMetadata                         2 calls
        3 ms  FodyUpdateCopyLocalFilesTarget             1 calls
        3 ms  _GenerateAndroidAssetsDir                  1 calls
        3 ms  _CollectConfigFiles                        1 calls
        3 ms  _ComputeAndroidResourcePaths               1 calls
        3 ms  AssignTargetPaths                          3 calls
        3 ms  _CollectLibraryResourceDirectories         1 calls
        4 ms  _SetEmbeddedWin32ManifestProperties        2 calls
        4 ms  _CopyMdbFiles                              1 calls
        4 ms  _WriteResolvedAssemblies                   1 calls
        5 ms  _GenerateCompileDependencyCache            2 calls
        5 ms  _AddStaticResources                        1 calls
        5 ms  _ResolveSdks                               1 calls
        5 ms  _ConvertCustomView                         1 calls
        6 ms  _ResolveMonoAndroidSdks                    1 calls
        8 ms  ImplicitlyExpandDesignTimeFacades          1 calls
       10 ms  CopyFilesToOutputDirectory                 2 calls
       11 ms  _CollectMdbFiles                           1 calls
       11 ms  _CollectPdbFiles                           1 calls
       12 ms  _BuildAdditionalResourcesCache             1 calls
       12 ms  IncrementalClean                           2 calls
       13 ms  _PrepareAssemblies                         1 calls
       15 ms  _HandlePackageFileConflicts                2 calls
       16 ms  _GeneratePackageManagerJava                1 calls
       17 ms  _GetPrimaryCpuAbi                          1 calls
       19 ms  _BuildLibraryImportsCache                  1 calls
       20 ms  _AddAndroidCustomMetaData                  1 calls
       23 ms  ResolveNuGetPackageAssets                  1 calls
       23 ms  _ConvertResourcesCases                     1 calls
       24 ms  _DetermineJavaLibrariesToCompile           1 calls
       28 ms  _ConvertLibraryResourcesCases              1 calls
       32 ms  _CopyPdbFiles                              1 calls
       33 ms  _CopyFilesMarkedCopyLocal                  1 calls
       39 ms  FindReferenceAssembliesForReferences       2 calls
       39 ms  _GenerateAndroidResourceDir                1 calls
       41 ms  _FindJavaStubFiles                         1 calls
       43 ms  ResolveProjectReferences                   2 calls
       44 ms  _GenerateSatelliteAssemblyInputs           2 calls
       45 ms  _CleanGetCurrentAndPriorFileWrites         2 calls
       85 ms  _ResolveSatellitePaths                     1 calls
       87 ms  _GetProjectReferenceTargetFrameworkProperties   3 calls
      156 ms  _CopyIntermediateAssemblies                1 calls
      197 ms  ResolveAssemblyReferences                  2 calls
      313 ms  _ResolveAssemblies                         1 calls
      329 ms  XamlC                                      2 calls
      366 ms  _CreateBaseApk                             1 calls
      534 ms  _UpdateAndroidResgen                       1 calls
      585 ms  _CompileResources                          1 calls
      815 ms  _LinkAssembliesNoShrink                    1 calls
      843 ms  _GenerateJavaStubs                         1 calls
     1326 ms  _ResolveLibraryProjectImports              1 calls
     1514 ms  CoreCompile                                2 calls
     2126 ms  _CompileJava                               1 calls
     2570 ms  _CompileAndroidLibraryResources            1 calls
     5151 ms  _CompileToDalvikWithD8                     1 calls
        (* = timing was not recorded because of reentrancy)

Task Performance Summary:
        * ms  MSBuild                                    5 calls
        0 ms  GetAppSettingsDirectory                    1 calls
        0 ms  ResolveNonMSBuildProjectOutput             1 calls
        0 ms  Telemetry                                  1 calls
        0 ms  FindAppConfigFile                          2 calls
        0 ms  GetAndroidDefineConstants                  1 calls
        0 ms  CalculateAdditionalResourceCacheDirectories   1 calls
        0 ms  CheckForInvalidResourceFileNames           1 calls
        0 ms  VectorDrawableCheckBuildToolsVersionTask   1 calls
        0 ms  GetJavaPlatformJar                         1 calls
        0 ms  GetReferenceAssemblyPaths                  2 calls
        0 ms  ResolveXamarinAndroidTools                 1 calls
        0 ms  ProduceContentAssets                       1 calls
        0 ms  ValidateJavaVersion                        1 calls
        0 ms  GetAndroidPackageName                      1 calls
        0 ms  FindLayoutsToBind                          1 calls
        0 ms  ReadAdditionalResourcesFromAssemblyCache   1 calls
        0 ms  CalculateLayoutCodeBehind                  1 calls
        0 ms  CheckProjectItems                          1 calls
        0 ms  GetReferenceNearestTargetFrameworkTask     1 calls
        0 ms  GetAssemblyVersion                         1 calls
        0 ms  GetExtraPackages                           2 calls
        1 ms  ReadLinesFromFile                          2 calls
        1 ms  CreateTemporaryDirectory                   2 calls
        1 ms  AssignProjectConfiguration                 2 calls
        1 ms  ComputeHash                                1 calls
        1 ms  ResolveAndroidTooling                      1 calls
        1 ms  AssignLinkMetadata                         2 calls
        1 ms  CheckDuplicateJavaLibraries                1 calls
        1 ms  CollectLibraryAssets                       1 calls
        1 ms  AssignCulture                              3 calls
        1 ms  CreateResgenManifest                       1 calls
        1 ms  JoinItems                                  1 calls
        1 ms  CreateCSharpManifestResourceName           1 calls
        1 ms  RemoveDir                                  1 calls
        1 ms  GetMonoPlatformJar                         1 calls
        1 ms  ReadImportedLibrariesCache                 1 calls
        1 ms  DetectIfAppWasUninstalled                  1 calls
        1 ms  ReadLibraryProjectImportsCache             1 calls
        2 ms  ConvertToAbsolutePath                      2 calls
        2 ms  ApplyImplicitVersions                      1 calls
        2 ms  ReadAndroidManifest                        1 calls
        2 ms  ResolvePackageAssets                       1 calls
        2 ms  AdjustJavacVersionArguments                1 calls
        2 ms  Fody.UpdateReferenceCopyLocalTask          1 calls
        2 ms  CopyResource                               2 calls
        2 ms  AssignTargetPath                          15 calls
        2 ms  CopyRefAssembly                            1 calls
        2 ms  CheckForDuplicateItems                     3 calls
        2 ms  MakeDir                                    8 calls
        2 ms  PrepareAbiItems                            3 calls
        2 ms  RemoveDirFixed                             2 calls
        2 ms  CheckForImplicitPackageReferenceOverrides   1 calls
        2 ms  Message                                   18 calls
        2 ms  CopyGeneratedJavaResourceClasses           2 calls
        2 ms  CollectNonEmptyDirectories                 1 calls
        3 ms  ResolveSdks                                1 calls
        3 ms  CreateProperty                            39 calls
        3 ms  RemoveUnknownFiles                         2 calls
        3 ms  GetFrameworkPath                           2 calls
        3 ms  Hash                                       4 calls
        4 ms  AndroidComputeResPaths                     2 calls
        4 ms  ConvertCustomView                          1 calls
        5 ms  AppendCustomMetadataToItemGroup            2 calls
        7 ms  RemoveDuplicates                           4 calls
        9 ms  ResolveNuGetPackageAssets                  1 calls
        9 ms  WriteLinesToFile                          11 calls
       11 ms  GetAdditionalResourcesFromAssemblies       1 calls
       11 ms  CollectPdbFiles                            1 calls
       12 ms  Delete                                     6 calls
       13 ms  ResolvePackageFileConflicts                2 calls
       14 ms  GetFilesThatExist                          2 calls
       15 ms  GeneratePackageManagerJava                 1 calls
       15 ms  FilterAssemblies                           1 calls
       17 ms  GenerateLibraryResources                   1 calls
       17 ms  GetPrimaryCpuAbi                           1 calls
       18 ms  GetImportedLibraries                       1 calls
       19 ms  Touch                                     25 calls
       23 ms  DetermineJavaLibrariesToCompile            1 calls
       32 ms  FindUnderPath                             10 calls
       40 ms  Copy                                       7 calls
       48 ms  ConvertResourcesCases                      2 calls
       53 ms  CreateItem                                20 calls
      208 ms  CopyIfChanged                              5 calls
      245 ms  GenerateResourceDesigner                   1 calls
      281 ms  ResolveAssemblyReference                   3 calls
      307 ms  ResolveAssemblies                          1 calls
      326 ms  XamlCTask                                  1 calls
      625 ms  Aapt2Link                                  2 calls
      811 ms  LinkAssemblies                             1 calls
      841 ms  GenerateJavaStubs                          1 calls
     1324 ms  ResolveLibraryProjectImports               1 calls
     1504 ms  Csc                                        1 calls
     2123 ms  Javac                                      1 calls
     3145 ms  Aapt2Compile                               2 calls
     5147 ms  D8                                         1 calls
        (* = timing was not recorded because of reentrancy)

Build succeeded.

Any comments / feedback for how we can improve this experience?

I expected to see better results for the build (and deploy) part, which is my biggest complaint with Xamarin Android atm. On Windows my coworkers see much worse results, taking up to 1 minute longer for each deploy. Developing an app with this kind of slow devloop experience is not optimal.

The app size is a bit confusing too: since .aab doesn't show the "APK Size" I'm not entirely sure if my assumption that, since this is an Android App Bundle, the download size is the same as its installed size is correct. Which makes the whole purpose dubious, how do I know if I am getting any improvement at all?

I can't provide a build log here because of sensitive information, but I would be happy to contribute with this under NDA if you want.

Version Information (Help -> About Visual Studio -> Copy Information)

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.2.4 (build 17)
Installation UUID: 530df999-4e8f-42fa-a951-02c122de810e
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

	Package version: 600000327

=== Mono Framework MDK ===

Runtime:
	Mono 6.0.0.327 (2019-02/f8ea05bddcb) (64-bit)
	Package version: 600000327

=== NuGet ===

Version: 5.1.0.6013

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.2.6
	2.2.3
SDK: /usr/local/share/dotnet/sdk/2.2.401/Sdks
SDK Versions:
	2.2.401
	2.2.105
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.3 (14492.2)
Build 10G8

=== Xamarin.Mac ===

Version: 5.14.0.114 (Visual Studio Enterprise)
Hash: c6691164
Branch: d16-2
Build date: 2019-07-29 15:54:06-0400

=== Xamarin.iOS ===

Version: 12.14.0.114 (Visual Studio Enterprise)
Hash: c6691164
Branch: d16-2
Build date: 2019-07-29 15:54:05-0400

=== Xamarin Designer ===

Version: 16.2.0.379
Hash: 3f0652957
Branch: remotes/origin/d16-2
Build date: 2019-08-01 17:32:50 UTC

=== Xamarin.Android ===

Version: 9.4.1.0 (Visual Studio Enterprise)
Commit: xamarin-android/d16-2/ebd65c9
Android SDK: /Users/mahmoud/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		8.0 (API level 26)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.0
SDK Build Tools Version: 28.0.3

Build Information: 
Mono: mono/mono/2019-02@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-2@d64ada5
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/mahmoud/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 1.2.0.60
Hash: 686c817
Branch: remotes/origin/d16-2
Build date: 2019-08-07 15:49:58 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 802040017
Git revision: 9b155edbf23e9fe8b477b3236a342164fabf5f6b
Build date: 2019-08-16 00:21:01+00
Build branch: release-8.2
Xamarin extensions: 9f2598b5f2371ba2903988c2cd87a9759d0255f2

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
    Thu Jun 20 18:42:21 PDT 2019
    root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

Vim 0.65.3
XAML Styler 1.1.3
@JonDouglas

This comment has been minimized.

Copy link
Owner

@JonDouglas JonDouglas commented Sep 16, 2019

@akamud Thank you so much for your submission! To claim your swag, please fill out this quick survey!

http://aka.ms/androidappchallenge

@JonDouglas JonDouglas closed this Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.