Xcode 14 unintentionally increases app size
emergetools.com
emergetools.com
This is besides the point, but is anyone else concerned just how insane those sizes are? There are operating systems smaller than that, why is that needed for a single app from a sports brand? What is this app even supposed to do? How much functionality did they need to cram into it to get a 180MB binary? Why does the app even exist? Why does it apparently need 160MB of just text to do whatever unfathomable job it has?
"Programming went back to the beginning of time. It was a little like the midden out back of his father’s castle. Where the creek had worn that away, ten meters down, there were the crumpled hulks of machines — flying machines, the peasants said — from the great days of Canberra’s original colonial era. But the castle midden was clean and fresh compared to what lay within the Reprise’s local net. There were programs here that had been written five thousand years ago, before Humankind ever left Earth. The wonder of it — the horror of it, Sura said — was that unlike the useless wrecks of Canberra’s past, these programs still worked! And via a million million circuitous threads of inheritance, many of the oldest programs still ran in the bowels of the Qeng Ho system. Take the Traders’ method of timekeeping. The frame corrections were incredibly complex — and down at the very bottom of it was a little program that ran a counter. Second by second, the Qeng Ho counted from the instant that a human had first set foot on Old Earth’s moon. But if you looked at it still more closely … the starting instant was actually about fifteen million seconds later, the 0-second of one of Humankind’s first computer operating systems. So behind all the top-level interfaces was layer under layer of support. Some of that software had been designed for wildly different situations. Every so often, the inconsistencies caused fatal accidents. Despite the romance of spaceflight, the most common accidents were simply caused by ancient, misused programs finally getting their revenge."
- Vernor Vinge, "A Deepness in the Sky"
The next major component is the orange “strings” files like “Localizable.strings”. These are repeated a bunch of times, once for each (human) language that the app supports. If you click on them to zoom in, you will see that there is one called “el.lproj/Localizable.strings”, a “ru.lproj/Localizable.strings”, “pl.lproj/Localizable.strings”, and so on.
Finally there are the blue “text” sections, which is the actual executable code (the name is historical, these sections actually contain binary machine code rather than readable text).
There are no exact counts on the webpage, but I would say that the executable code is around a third of the size of the app, possibly less.
And of course, the whole point of the article is that these apps now have a fourth major component: debugging symbols. These give you the name of every variable and function used in the program, as well as the filenames and line numbers for each instruction in the executable code. These are over 40% of the app size just by themselves. Because these symbol tables are so large, it has been increasingly common to split them out into their own files and only distribute them to your own developers, rather than to every user’s machine.
[0] - https://forums.swift.org/t/reducing-value-witness-size-in-st...
150k lines of objective-c will be significantly smaller than 100k lines of swift pretty much any day of the year.
Look at tweetbot for example, still objective c for the most part, a fairly complicated app, still actively developed and only 30MB.
Most of those apps use a lot of common libraries that add a lot of size to the binaries.
I'm flatly amazed that sort of thing isn't some kind of bitmap/vector hybrid format. Like a high resolution central logo and then rules for defining the background, like "blue fading to white at the edges".
However custom images can still be set for every possible size, if you really want
[1] https://developer.apple.com/documentation/xcode/specifying-y...
PNG files (if not generated from a jpg) are quiet small.
The source of the PNG doesn't matter.
This is it. Developers on broadband and tight budgets don't care about app size. On the App Store there's usually no direct correlation between app size and conversion rate: the app will eventually be available anyway.
Every line I write - line I need to support.
Why would the "battletested" be better ? It is "battletested" by the user, anyway.
> Every line I write - line I need to support.
So you prefer to support someone elses code instead of yours ? ( because it is battletested - just like log4j was)
Your tense is incorrect there. "Battletested" means that past users have experienced the carnage of war, so current users can enjoy peace. Your second usage would need to be changed to present tense, like "battletesting", where you subject them to suffering.
Functionality wise so many of these apps could've been achieved on Windows 3.1, and yet they're 3-4 orders of magnitude larger
Incidentally, the TreeMaps provided in this article are really amazing. If every scientific paper provided this level of access to their data, we would be a lot better off.
These apps were most probably optimized for developer speed, and not for size or user experience.
This is a thoroughly researched article that clearly shows the cause and provides a solution. I hope the developers of these apps will take heed.
Perfect for reversing.
However there are some practical purposes od obscurity like in games that madd reverse engineering harder (though possible of course), it might become easier in some situations.
It's generic for a little while as long as things don't change too much, but eventually they do.
See WWDC talk about watchOS migration to 64 bits.
With the end of support for the Apple Watch Series 3 (armv7k abi), I guess it was discontinued by Apple as they no longer needed Bitcode. Is there something I misunderstood?
> I may compile a C code to Bitcode and have LLVM generate a running binary for x86 CPUs in the end. If I save the Bitcode, however, I can later on tell LLVM to also create a running binary for an ARM CPU from that Bitcode, without having to compile anything and without access to the original C code. And the generated ARM code will be as good as if I had compiled to ARM from the very start.
There is some other stuff in the answer that is interesting (eg. that Apple apparently never actually used Bitcode for iOS, despite what they implied)
My guess is that they planned to use Bitcode to do minor optimisations for new generations of their chips, but it turned out to not work in practice, and so they scrapped it.
With llvm-mca you can check how each micro architecture will behave differently for the same machine code: https://llvm.org/docs/CommandGuide/llvm-mca.html
However, "agnostic" usually means that behavior doesn't vary. Performance is orthogonal to behavior in this case. I definitely don't expect code optimized for Haswell to be as fast on a Broadwell as code optimized for Broadwell, but I do at least expect it to run.
2 - "You say, I say", school playground stuff, unless you actually have something to show beyond yes and no words.
Did they give up on this idea? Was it not worth it?
EDIT: ridiculous_fish posted a link with some surmises on this question.
Before the first 64-bit watch was announced they were very vague and hand-wavy about what bitcode was for because they had to keep the upcoming products a secret, and sort of implied that it'd be used for things which didn't actually make very much sense.
Working in a company that builds both Android and iOS application I have to say that building iOS apps generates 10x the problems that you have with building Android applications, in terms of CI infrastructure, that means that Android you run gradlew and it works, provided you have the right JVM version installed, with XCode it's always a mess. Also for how it works the ecosystem with Android I'm not forced to upgrade, that means that if a project uses SDK X I can build it forever with that SDK and it will still work even on latest devices, with Apple you have to build with the latest toolchain if you want to execute on newer terminals. That makes Android far more suitable for b2b applications.
In any case, Intel devices used to have ARM emulators, and Android on ChromeOS still does it.
https://developer.android.com/topic/arc/device-support#arm-t...
It might be relevant, however Google's own documentation and tooling during the last decade is quite clear that one should stay out unless doing games.
Certainly not the first, yet it shows how it can look like when everyone is committed to make it happen, unlike what WinDev did during Longhorn project.
Somehow people keep missing that Apple's clang and LLVM aren't the same one gets from clang.org.
I tried running `strip -rSTx` on an ad-hoc binary that contained only C/C++/ObjC code (no Swift) and it had no effect.
It does have an effect on binaries with Swift code.
$ echo 'int main() { return 0; }' > main.c && gcc main.c && file a.out
a.out: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6e4c5817c9bf2ddcc5a2dfe6d9d9729526c81aed, for GNU/Linux 4.4.0, with debug_info, not stripped
$ strip a.out && file a.out
a.out: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6e4c5817c9bf2ddcc5a2dfe6d9d9729526c81aed, for GNU/Linux 4.4.0, strippedIt is good to know that there are ways around the bloat. It does beg: why do app developers release such bloated garbage when it would be easy to address?
Update: This sounds like a pretty good explanation: https://stackoverflow.com/questions/72543728/xcode-14-deprec...
"The capability to build with bitcode will be removed in a future Xcode release."
Yea that is the plan from Apple.
If the user doesn't care and Apple doesn't care, then the company probably isn't going to care either.
Will throw a spanner into the 'we can't release that feature as it will increase app size' thinking that I've witnessed in my mobile dev career. I've never seen it actually impact metrics that much.
Makes me feel old. I'm sure 20 years ago I could have told you say what app/game had been installed from floppies and which was "CD ROM only" My phone apps? Couldn't even guess as to their storage requirements. Probably a good thing that storage is so plentiful we normally don't care - but cynic in me thinks that a company selling storage with a massive markup, maybe doesn't have aligned interests.
If 0.1% of people install an app, and it consumes a gig rather than 500Meg - and we sell millions of phones. That does turn into a real money pretty fast.
If they really want your app, they'll look through the storage settings on their phone, and start deleting their biggest apps.
So if your app is too big, many people won't even install it, and if they do, it'll be the first app to go if they need more space.
I just moved from android to apple and the IOS apps are 2x - 5X larger
It's really a disgusting tax and I install a lot less apps as a result.
They could easily fix this by adding intelligence in the App store, to serve up the binary for my device's architecture, but no, I have to get the universal bloated binary pig.
Example: You're about to pay your bill at a restaurant. The server tells you that they have an app that will get you a discount/loyalty points. Your cell has a 4G connection. On android, the download size is 20-50MB. No problem. On IOS, the download size is 40-240MB. Problem!
See the app thinning section here: https://developer.apple.com/documentation/xcode/doing-advanc... (which is automatically done on all apps distributed through the App Store)
I am also an Android dev and maintaining APK size has always been part of the dev process from the start. Apple is just so bad in policing their IPA size. And it is getting worse.
And in some places 200 MB can still be a big deal, the whole world isn't on 20 GB data plans.
Last year we ran a test which involved artificially bloating one of our IPAs from 160mb to 260mb* and compared the app performance metrics* before and after the change, we saw no meaningful difference between the two versions.
By using the app thinning mechanism, you can create a different IPA sizes for different devices.
* CPI, CPS etc.
A great example is 'make that feature entirely as a WebView to our site so we don't increase app size'.
Some of the other features may require an app.
- Getting warned about app size over cellular, which in iOS happens at 200MB.
- In geographies where cellular data is expensive, slow or intermittent.
- At the margin when you have many millions of users. The data bears out that it does have a small but measurable impact.