This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove Xamarin.Android.Support.v7.MediaRouter #5941
Merged
PureWeen
merged 1 commit into
xamarin:master
from
jonathanpeppers:android-remove-mediarouter
Apr 23, 2019
Merged
Remove Xamarin.Android.Support.v7.MediaRouter #5941
PureWeen
merged 1 commit into
xamarin:master
from
jonathanpeppers:android-remove-mediarouter
Apr 23, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context: dotnet/android#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!
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
I'm not sure how to read these CI results? I mostly see things like this: If there is a failure here, ping me and I'll take a look. Thanks! |
PureWeen
approved these changes
Apr 23, 2019
Contributor
PureWeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI Tests seem fine
Once @paymicro approves we can merge
paymicro
approved these changes
Apr 23, 2019
AxelUser
pushed a commit
to AxelUser/Xamarin.Forms
that referenced
this pull request
Jun 15, 2019
Context: dotnet/android#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!
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Dec 6, 2019
I also improved things so it's easier to bump this going forward: * I added `KnownPackages.XamarinForms_LatestStable`, so tests won't need to change going forward. * `Xamarin.Forms.Performance.Integration` now uses `<PackageReference/>`. The netstandard library was already. I also removed some missing `Icon` files from the forms project. These did not even exist. `XamarinFormsPCL_2_3_4_231` was also unused, so I removed it. I updated APK sizes, which I think is smaller because of: xamarin/Xamarin.Forms#5941
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Dec 9, 2019
I also improved things so it's easier to bump this going forward: * I added `KnownPackages.XamarinForms_LatestStable`, so tests won't need to change going forward. * `Xamarin.Forms.Performance.Integration` now uses `<PackageReference/>`. The netstandard library was already. I also removed some missing `Icon` files from the forms project. These did not even exist. `XamarinFormsPCL_2_3_4_231` was also unused, so I removed it. I updated APK sizes, which I think is smaller because of: xamarin/Xamarin.Forms#5941
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Context: dotnet/android#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
_CompileDexstep 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:
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
Debugbuild ofXamarin.Forms.ControlGallery.Android.csprojfor comparison.Comparing dex file sizes (in bytes):
This looks like it could potentially save ~600KB of compiled dex code
on every Xamarin.Forms app.
Comparing methods:
~1,137 methods removed, which should help with the dex limit.
Comparing APK sizes (in bytes):
~700KB smaller APK, due to less .NET assemblies & dex code.
Comparing build time (this was using dx):
Looks like it saved over a second of build time for this project.
Seems like an "easy win", let's do this!
Issues Resolved
none
API Changes
None
Platforms Affected
Behavioral/Visual Changes
Only known behavior, is a user might have to add
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />if they are using it directly.Before/After Screenshots
Not applicable
Testing Procedure
If Xamarin.Forms apps build with this change, things should work.
PR Checklist