зеркало из https://github.com/DeGsoft/maui-linux.git
78d662ee7d
Context: https://github.com/xamarin/xamarin-android/issues/2982 The Blank Xamarin.Forms app template in VS 2019 takes longer to build than in VS 2017. A little research is showing that this is due to use of the 28.x support libraries... For example, the build includes ~20 *more* jar files in the template from 2019 than 2017. The `_CompileDex` step alone goes from ~15.2s to ~18.2s. This lead me down the road of investigating if we can remove any support libraries by default in Xamarin.Forms apps. I am also seeing if there is more we can do in Xamarin.Android for this problem, in general. It looks like we can remove: * Xamarin.Android.Support.v7.MediaRouter * Xamarin.Android.Support.Media.Compat Neither of these appear to be used, but have been listed as dependencies of Xamarin.Forms for a long time. ~~ Results ~~ I made these changes, then did a `Debug` build of `Xamarin.Forms.ControlGallery.Android.csproj` for comparison. Comparing dex file sizes (in bytes): Before: 3428092 classes.dex 3265616 classes2.dex 6693708 total After: 4938000 classes.dex 1098772 classes2.dex 6036772 total This looks like it could potentially save ~600KB of compiled dex code on every Xamarin.Forms app. Comparing methods: Before: classes.dex 11,492 methods classes2.dex 19,451 methods total 30,943 methods After: classes.dex 22,171 methods classes2.dex 7,635 methods total 29,806 methods ~1,137 methods removed, which should help with the dex limit. Comparing APK sizes (in bytes): Before: 26442597 AndroidControlGallery.AndroidControlGallery-Signed.apk After: 25741701 AndroidControlGallery.AndroidControlGallery-Signed.apk ~700KB smaller APK, due to less .NET assemblies & dex code. Comparing build time (this was using dx): Before: 19785 ms CompileToDalvik 1 calls After: 18532 ms CompileToDalvik 1 calls Looks like it saved over a second of build time for this project. Seems like an "easy win", let's do this! |
||
---|---|---|
.. | ||
PagesGallery | ||
PagesGallery.Droid | ||
PagesGallery.Tizen | ||
PagesGallery.UWP | ||
PagesGallery.iOS |