https://kotlinlang.org logo
a

Anton Afanasev

09/30/2021, 6:41 PM
Hi. What do you do with high binary sizes on iOS? I have watched this talk

https://www.youtube.com/watch?v=hrRqX7NYg3Q&t=1892s

from Kevin Galligan from a year ago. Wondering if anybody knows anything about progress on reducing the sizes, K\N-Swift interop
k

kpgalligan

09/30/2021, 11:46 PM
Can discuss. What kind of numbers are you getting and how do you measure?
b

Brian G

09/30/2021, 11:46 PM
I find the binary size to be quite acceptable. My final *.ipa is <20MiB which is not bad. What's yours?
a

Anton Afanasev

10/01/2021, 12:17 PM
My .framework is around ~15 mb. For a pretty small sdk with a couple of standard dependencies like ktor. I am fine with that, but you know...customers complains. So I must check if there are anything to do with binary sizes. I tried "internalizing" all I could. And there were a pretty nice effect. I actually saw a reduction of ~500 kb after doing that on a bunch of data classes. Wonder if there are anything else that can help to downsize. @kpgalligan I remember you were talking about KMM team working on K\N - Swift interoperability which should reduce the size. Wondering if there are any progress on that. I read somewhere that this work was frozen.
k

kpgalligan

10/01/2021, 12:21 PM
Well, again, to measure the actual size, you need to either push it to the app store and let apples servers crunch numbers, or run local size estimates with Xcode. The size on your dev disk is not wha the actual app size will be. I don't remember how I presented it in that talk (and I have a talk today that I'm really not prepared for, so I don't have a lot of time to reply here...), but raw numbers on disk don't really tell the story. For KaMP Kit, which has ktor, sqldelight, and a few others, our sizes were ~1.5m as a final size increase on real devices. I assume local disk size was much larger, but it's been a while.
a

Anton Afanasev

10/01/2021, 12:22 PM
Wow, thats are really great numbers.
k

kpgalligan

10/01/2021, 12:22 PM
a

Anton Afanasev

10/01/2021, 12:22 PM
thaks. Looking into that
👍 1
k

kpgalligan

10/01/2021, 12:23 PM
They're not 100% the same as uploaded, but very close.
a

Anton Afanasev

10/01/2021, 10:39 PM
Thank you @kpgalligan for great advise. With the help of our iOS team I was able to run the size report and results were pretty good looking. Original
~26mb
.framework file was reduced to
~6mb
. I believe it should calm down our client. However, for educational purpose I am wondering if anybody have any understanding about processes that makes this downsize actually happen. Why initial .framework is so big and how it is downsized...
k

kpgalligan

10/02/2021, 4:52 PM
I don't have a ton of detail, but there are a number of things. Debugging info, possibly multiple architectures (actual device only needs one). Probably a bunch of other stuff. It's not unique to kotlin. Ios size estimation can be complicated
🙏 1
6 Views