by rakingleaves on 2/26/21, 5:42 PM with 202 comments
by bhupy on 2/26/21, 5:56 PM
by sond813 on 2/26/21, 6:56 PM
We parse Obj-C and Swift runtime metadata to determine size contributions of individual types and functions in your app. We use this analysis to post PR comments with granular size diffs to help devs write smaller, better code.
I tried it out on the Uber app and immediately noticed a disproportionate impact from their code-gen dependency injection framework, Needle. The codegen is responsible for over 30k classes in the app binary, and contributes over 10mb! In general codegen is a common problem with Swift binary sizes, and the fewer reference types generated the better, it even helps with startup time!
We’ve written a blog post with case studies about how 7 of the most popular iOS apps could reduce their size: https://medium.com/swlh/how-7-ios-apps-could-save-you-500mb-...
by danpalmer on 2/26/21, 6:38 PM
Currently they only deliver the binary for the device's CPU, and only the assets for the device's asset class. There's then some tech targeted at game devs for on-demand assets for things like game levels that you don't need all of on device at one time.
I suspect the limitations of this are around the binary not being subject to this, but maybe it could be. I can see a couple of options, one is some way of extending the asset classes to code features, so that the App Store doesn't have to download iPad screens for iPhones, etc. Perhaps this could be extended with either App Store account region or locale so that, Uber in this example could not include the Venmo SDK outside of the US where no one has heard of Venmo.
Or perhaps Apple could extend the on-demand assets to allow for some sort of plugin system, perhaps backed by Swift Packages, such that apps can on-demand decide they need the Venmo SDK because they're in the US, and download just that. I don't think we want a generalised package manager here, I don't envision that SDK coming from Venmo directly, but allowing an app author to upload all their separate packages if they want to.
With feature heavy, international apps such as Uber I'd expect this to dramatically improve things. I'm not sure whether this benefit would translate to that much demand across the whole App Store though as I think this matters more to a very few big apps. Apple is at that optimisation point in the iOS lifecycle though so perhaps it's worth it to them.
by ketralnis on 2/26/21, 5:59 PM
> The choice of Swift as our primary programming language, our fast-paced development environment and feature additions, layered software and its dependencies, and statically linked platform libraries result in large app binaries
but can somebody familiar with iOS development explain what makes app bundles so big? Actual CPU instructions or config can't contribute this significantly. The entire Bible is about 4.5mb. If you're writing an app by yourself you almost certainly didn't write that much text in the source code. A sibling comment links to https://news.ycombinator.com/item?id=25376346 which says that they have a lot of screens but even something like "PayTM (15+ screens)" is still just textual source code and config that I don't follow how it gets beyond kilobytes. The App Store places them at 309mb, so ~68 bibles.
I understand when games are large because they typically ship with images and videos included in the binary for game assets. But for a normal application where does the size come from?
Is it dependencies? (And how did _they_ get so big?) That weird intro video they have on the loading screen? Are they shipping bitmaps of the cities they have markets in?
by viktorcode on 2/26/21, 9:16 PM
I wonder if Uber is planning to do anything about that? The technique described in the article (whole program instructions outlining optimisation) is a band aid style solution, merely delaying the inevitable: the code produced by numerous teams independent of each other will inevitably cross first the download size limit threshold, and later maintainability threshold.
by dmitriid on 2/26/21, 5:54 PM
Includes, among other things: forcing Apple to increase cellular download limits, 45 seconds for letters to appear in XCode, 12 seconds to call main, rewriting the linker and so on.
by saagarjha on 2/26/21, 10:29 PM
by whoisburbansky on 2/26/21, 6:16 PM
Made me chuckle. Maybe the authors should look at getting an ACM subscription.
by etaioinshrdlu on 2/26/21, 9:41 PM
by thegeomaster on 2/26/21, 5:56 PM
What?
Linux has 30 million of C!
I'm speechless. I cannot fathom how & why.
by abductee_hg on 2/26/21, 8:52 PM
by speedgoose on 2/26/21, 5:55 PM
by dj_mc_merlin on 2/26/21, 11:04 PM
by mshockwave on 2/27/21, 2:09 AM
I think adding machine outlining into LLVM Pass pipeline is still doable with LLVM plugin (with new PassManager)...worst case just come up with a custom LLVM/Clang
by londons_explore on 2/27/21, 11:25 AM
Compiling that down to 200 MB isnt too shabby!
by lgats on 2/27/21, 5:40 AM
If your app has larger images, don't waste user bandwidth and optimize your assets!
by elpakal on 2/26/21, 9:04 PM
> Overall, 5 rounds of outlining builds in 66 minutes — a 45-minutes addition to the baseline.
by rockmeamedee on 2/26/21, 9:49 PM
by alien_ on 2/26/21, 10:17 PM
by pid_0 on 2/27/21, 12:00 AM
by tomaskafka on 2/26/21, 7:33 PM
Build times in tens of minutes seem terrible.
by ketamine__ on 2/27/21, 12:11 AM
by Triv888 on 2/27/21, 10:30 AM
by pgp001 on 2/26/21, 10:26 PM
by BigBalli on 2/26/21, 6:04 PM
by StreamBright on 2/26/21, 8:40 PM
by ohiovr on 2/26/21, 5:44 PM
by superkuh on 2/26/21, 6:31 PM
That their "app" is large is irrelevant to the scam.