Skip to content

Setting $(EnableLLVM) to true adds to the APK size increase of APKs built by Xamarin.Android 10.0.0.43 vs. 9.4.1.1 #3724

@brendanzagaeski

Description

@brendanzagaeski

This is a new item for discussion about size increases related to $(EnableLLVM), previously discussed in #3454. It seems that $(EnableLLVM) might have itself introduced a size increase, adding to the (perhaps expected) increases in size of the managed input assemblies.

tranb3r commented on Sep 5 #3454 (comment)

Apk size:

  • vs 16.3.0 preview 1.0 : 24438 kB
  • vs 16.3.0 preview 3.0 : 26688 kB

I'm using AOT+LLVM, and the average increase of .so files seems to be around 10.5%.
But interestingly, the increase of libmonodroid_bundle_app.so (bundle of the dlls) is only about 2.5%.
So maybe there is another issue specific to aot/llvm ?

About java bindings, I'm using a lot of nugets, and I have no idea how many of them contain java bindings. But pretty much every single .so file is increasing in size in the apk.


tranb3r commented on Sep 24 #3454 (comment)

Here is the correct comparison between 16.3-pre1 and 16.3-pre3:
apksize

As you can see, the size difference for so libs is quite important (+11%), much more than the impact on dlls (+2.5%), which results in apk size increasing by +9%.
This is why I think there is still an issue that needs to be explained / fixed.

Or maybe I've made another mistake ? Could you please double check with another app and confirm my results ?


tranb3r commented on Sep 25 #3454 (comment)

Here is more data from our app (same code compiled with different versions of VS 2019) :

VS2019 Xamarin.Android APK (kB) lib\arm64-v8a (B) libmonodroid_bundle.so (B) classes.dex (B)
16.2.0 9.4.0.51 24679 60196936 6579296 3207436
16.2.1 9.4.1.0 29321 76671880 7979888 3816684
16.2.4 9.4.1.1 24916 61047856 6656880 3208892
16.3.0 10.0.0.43 26687 67170624 6754992 3054440

Here are our conclusions:

  • the original linker bug was introduced in xamarin.android 9.4.1.0 (shipped with vs 16.2.1 stable), resulting in a huge increase of apk size.
  • the linker bug was then fixed in xamarin.android 9.4.1.1 (shipped with vs 16.2.4 stable), and the apk size was almost back to normal.
  • however, for some unexplained reason, in xamarin.android 10.0.0.43 (shipped with vs 16.3.0 stable), the apk size increases again, mostly because of aot libs (the bundle of dlls also increases but less the aot libs ; and the classes.dex file size decreases).

Could you please provide an explanation ? This is kind of serious for us.

Metadata

Metadata

Assignees

Labels

Area: Mono RuntimeMono-related issues: BCL bugs, AOT issues, etc.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions