I'm starting to evaluate the impact of a slow migration to Compose but I'm having an hard time under...
t
I'm starting to evaluate the impact of a slow migration to Compose but I'm having an hard time understanding the values in https://medium.com/androiddevelopers/jetpack-compose-before-and-after-8b43ba0b7d4f. How adding 4k methods results in a smaller dex size? Is there any other documents about the "weight" of compose during transition?
a
Simple math. 40029 * 2 > 43812 * 1.
b
That article doesn’t specifically call out dex size, but the dex size would definitely be included in “other”. You could pull down the code at various points during the transition and inspect the APK contents to find out for sure, but my assumption is that during the “mid-transition” period R8 was able to strip a lot of code for Views that were no longer being used.
t
@Albert Chang I guess math don't work the same in all countries then 😉 @Bryan Herbst Thanks that's what I would assume but then for my case it would be a long time before some types of views are no more used. 😞
a
I have no idea why you don't understand because basically I'm saying the same thing as Bryan. You do know that +4k can be +10k-6k right? Then it's simply 40000 * 2 > 34000 * 2 + 10000 * 1.
t
At time 1 there's 40k methods at time 2 there's 44K methods whatever reasons, at time 2 there's 4K more methods (There's no random *2 on one of the value). Now let's take your explanation imagine it's +10k -6K and that the 6K removed function are 2 times larger than the added ones. From the numbers of that article this gives final size would be approx 4MB not 3.76MB. So sorry your math either makes no sense or lack a missing detail to reach your numbers.
a
You asked
How adding 4k methods results in a smaller dex size?
and I answered exactly that question. And you mean you want the number that exactly match the result?
t
?? You said : 40029 * 2 > 43812 * 1.
How do you get that *2 out of nowhere?
a
It's an example meaning that even if there are more methods, the total size can be smaller if the average size is smaller.
Why do I have to explain it so detailedly as this...
t
Because that's not what you wrote so I asked for explanation about random info pushed as pure truth