10 ms·
Ask HN: How is Facebook's iOS app 491MB?
This is just insane. Photoshop takes less space than that, most fully functional desktop apps take less space than that. If you work for FB, or know someone who does, can you enlighten us as to what in the hell is in that HALF a GB (!!!) app?
- jerkstate 8y agoiOS can't handle their scale
- saagarjha 8y agoNope, considering that their app loads fine on most iOS devices…
- meguest 8y agohttps://blog.timac.org/2017/0410-analysis-of-the-facebook-app-for-ios-v-87-0/ https://blog.timac.org/2017/0410-analysis-of-the-facebook-ap...
- electricslpnsld 8y agoNew Moore's Law: Every year Facebook's iOS app doubles in size.
- reaperducer 8y agoThanks for that link. All the defenders of Facebook should read it. This was gold: @interface FBSearchModule : FBNativeAppModule_DO_NOT_USE_OR_YOU_WILL_BE_FIRED Somehow it me feel better about the things I produce.
- askafriend 8y agoHonestly I think it's funny and I appreciate a sense of humor from coworkers.
- reaperducer 8y agoI'm not disparaging it. Heck, I've got a debugging routine I use on one of my projects that's called panic_on_the_streets_of_london().
- kevinherron 8y agohttp://www.lmgtfy.com/?q=why+is+the+facebook+iOS+app+so+big%3F http://www.lmgtfy.com/?q=why+is+the+facebook+iOS+app+so+big%...
- tbrock 8y agoFacebook is not good at mobile. Uninstalling the app is the single best thing you can do for your phone battery life. Just use the mobile site with safari. It’s blazing fast and doesn’t slurp your address book or location and drain your battery.
- Operyl 8y agoOr just disabling background updates for the app.
- dzhiurgis 8y agoI noticed iOS still reports massive battery use with background refresh disabled.
- vonseel 8y agoHmm... I rarely open Facebook and it doesn’t show up near the top of my battery usage charts. Odd.
- 8fingerlouie 8y agoIn theory that would help, but Facebook appears to use all kinds of "clever" (dirty) tricks to stay running to slurp all that beautiful metadata up. I've had "background updates" disabled every since the option became available in iOS, and location updates only when i use the app, and yet somehow Facebook manages to stay running in the background for 3x longer than it's been on screen. We're talking 10 minutes on screen and 30-40 minutes of background activity. I realize some of it is notifications etc, which would trigger background activity, but that can hardly explain all of it. After watching Facebook eat 30% of my battery every day, i finally uninstalled it and use the mobile interface. Besides making by battery last a whole day longer between charges, it also has the added benefit of not receiving notifications, meaning less stuff to disturb me.
- Operyl 8y agoReally bizarre, I don't have that problem at all. It doesn't even make a dent in my battery charts (when compared to things like Phone).
- firloop 8y agoKeep in mind that the size of the app listed on the App Store is not actually the size of the app on device. Apple automatically removes unneeded assets [0] from the bundles based on the device that's downloading it. I just downloaded Facebook on my iPhone X and the app size came out to 314.5mb [1]. [0]: "App thinning" https://developer.apple.com/library/archive/qa/qa1795/_index.html https://developer.apple.com/library/archive/qa/qa1795/_index... [1]: https://imgur.com/a/lTJhMbx https://imgur.com/a/lTJhMbx
- deanCommie 8y agoThat's not a significant difference...
- firloop 8y agoI would say so; it's more than a third smaller than the figure quoted in the OP's title.
- rosser 8y agoIt's well over half again larger than any other app on my device, even after "thinning". Yes, it's a big savings, but it's still ludicrously large. At that point, I think it meaningfully falls into the "distinction without a difference" bucket.
- jstanley 8y agoIt's still the same order of magnitude, which is still way higher than is reasonable.
- adtac 8y agoTbh that is a significant decrease. Find me a compression algorithm that can compress already compressed binary data by 30% and I'll give you a million dollars (after I make a few million dollars myself).
- verelo 8y ago
- pvg 8y agoIf you want to post something complaining about how fat the FB app is and perhaps solicit comments from people who know about it, you should do that. It's not much of a 'Ask HN', though, because it's Ask HN, not 'spit take FB'.
- deleted 8y ago[deleted]
- smackfu 8y agoI’m sure part of it is A/B tests for tons of things. Doubled or tripled resources and code but any given user only sees one variety of them.
- Operyl 8y agoThe size you see on the App Store isn’t necessarily what the size will be when you install it to a device either. For example, on my iPhone 8 Plus is 307.3MB. https://imgur.com/a/VwkFvxg https://imgur.com/a/VwkFvxg
- saagarjha 8y agoYes, due to app thinning. But 300 MB is still an insane size for an app like this.
- adtac 8y agoAnd this doesn't include Messenger does it? The last time I had the misfortune of installing the app, they forced me to install a separate app for that. I figured I'd just use facebook.com on the browser, and I happily did until they removed chat from the mobile site. Now I use mbasic.facebook.com, which is incidentally much better because there's no bloated JavaScript (afaik). I'm sure they'll discontinue mbasic soon too; it'll be a shame because Messenger is all I use Facebook for.
- sidlls 8y agoThey employ a bunch of coders who are really good at solving textbook CS problems and whiteboarding medium/hard leetcode style questions but lack the experience, interest, and in some cases ability to stretch beyond that into, say, proper systems or application development. There are far too many of these individuals who are able to "contribute" to the application code base more or less without the supervision of properly experienced and qualified engineers (there was some article, I think on Reddit, about how the app used to have thousands or tens of thousands of classes, re-wrote large bits of iOS core libraries, etc.).
- pvg 8y agoThis seems like an implausibly detailed level of knowledge of Facebook's workforce, especially if derived from something you maybe saw on Reddit that was about something else.
- plicense 8y agoI think this is a totally baseless comment. 1. Have you worked at Facebook as an engineer before? Do you first hand know that most engineers working on FB iOS app lack the experience and interest? 2. Have you reverse engineered the FB app and verified that the app lacks signs of proper system or application development? There could be a good enough reason as to why the app re-wrote core iOS libraries - most popularly performance and missing features. Also, tens of thousands of classes don't directly translate to increased binary size - its usually the dependencies of the code that results in such large binary sizes. Overall, if Facebook wanted to optimize its app size to be less than 491MB, they would have. Maybe its on their roadmap, maybe they decided most of their userbase have the ability to download 491MB and it isn't impacting the growth funnel, heck maybe some of the engineers actually wanted to work on optimizing the app size but it was shot down by management. Slamming engineers who work at Facebook and calling them inexperienced is just mean.
- saagarjha 8y ago> Have you reverse engineered the FB app and verified that the app lacks signs of proper system or application development? Have you? The size of the core Facebook application binaries disagree with your statement of “tens of thousands of classes don't directly translate to increased binary size - its usually the dependencies of the code that results in such large binary sizes”.
- dsc_ 8y agoInstead of complaining, how about you fetch the package and reverse engineer it so you can answer your own question.
- zealsham 8y agoYou are the kind of guy that goes about writing writing a web server in assembly
- saagarjha 8y agoThis is not possible to do without a jailbroken device, which not everyone has.
- wonthegame 8y agoYou don't need to jailbreak in order to do that.
- saagarjha 8y agoHow do you remove FairPlay without a jailbroken device?
- AsyncAwait 8y agoIt probably is at least partially autogenerated, contains tons of legacy code, code for different markets, code for yet unreleased features, NSA tracking code...
- forg0t_username 8y agoI'd really like to give them the benefit of the doubt, but at this point it's sheer incompetence. It's been pointed out in the past, and it's still growing.
- zethraeus 8y agoBecause they write a lot of code. Because they experiment between a lot of experiences. Because there's a lot of legacy code. Because it's not an important constraint to them.
- jameslk 8y agoUnless it's a business concern (i.e. affecting one of the metrics the business is measuring and reporting), it's not on management's mind and therefore won't be prioritized as something worth improving or prevent from getting worse. Is it affecting app installs? Is it leading to a reduction of usage? No -> Don't fix. As an outsider, that would be my guess of how the app can grow to be so large, without knowing the reason why.
- underwater 8y agoThe app size hovered below 100MB for a log time, because that was Apple’s threshold for non-WiFi installs. Once they blew that budget it seems to have got out of hand.
- signal11 8y agoI just checked the App Store, it appears to have breached the 500MB barrier now: https://imgur.com/a/9LOrq1K https://imgur.com/a/9LOrq1K
- bitsquirrel 8y agoFor myself and friends and family, I maintain a Linux distro. It contains Chrome, LibreOffice, GIMP, Inkscape, Skype, not to mention a full OS and video drivers etc. And it's smaller than the iOS Facebook app.
- dedalus 8y agoI think this is due to the fact they refuse to use the underlying APIs for DNS, TCP, etc and reimplement all that functionality within the application. I think they are worried about apple or android removing access/throttling FB as they do not control the underlying platform (apple controls the devide, google controls the OS, and FB is the most deployed app across either platform)
- mabbo 8y agoIt seems silly. If platform X implements function A, and you're worried they might change how function A works, just wrap function A in an adapter class/interface. If they change it, you can then re-implement it the way you want.
- Someone 8y agoCan you run a separate network stack on iOS? How would that make network requests without using private APIs or accessing hardware directly, both of which Apple forbids?
- marczellm 8y agoI would be much more interested in details of the tech they use to bring iOS apps to Windows. Messenger for example looks like a direct port.
- saagarjha 8y agoThey acquired a company a while back called Osmeta that basically reimplemented parts of iOS.
- konart 8y agoAll dem tracking hacks... Need to be sure.
- amaccuish 8y agoI don't know if iOS has the equivalents but I personally use the "lite" versions of fb and messenger. Tempted to remove fb at some point and just use the browser tbh.
- 40acres 8y agoWhy does it matter? Modern smartphones have more than enough space.
- saagarjha 8y agoFavebook’s app is so large that they load code in dynamically so they can stay under the 20 second startup time limit imposed by iOS. Do you not see a problem there? Just loading the app into RAM means that you’ve consumed a substantial portion of it.
- williamdclt 8y agoNot really, a lot of phones are 8GB. Once you remove the OS and the pre-built apps that's about 5GB left. Just the FB app takes about 10% of that? That's not really acceptable. And that's not just theoretical: I have 16GB and I'm always scraping for storage
- saagarjha 8y ago> Not really, a lot of phones are 8GB Not many these days; the last iPhone that shipped with this configuration was the 5c four years ago (I had one; 8 GB sucked).
- tinus_hn 8y ago16GB only nets you about 20 of bloatware balloons like the Facebook app. That whole line of reasoning is just antisocial laziness. You pay for it so I don’t need to bother.
- drdrey 8y agoUnless it's a KPI you won't get an OKR to address it
- pavlov 8y agoI started at Facebook a month ago. Honestly, I was wondering the same thing as you: how does this app which seemingly is a couple of UITableViews contained in a UITabBarController end up taking so much space? I've come to realize that Facebook is sort of a global operating system for communities. Your Windows installation includes all the pieces to connect to an Active Directory enterprise network, even if all you'll ever do is play games from Steam. Facebook is like that: there's so much stuff you'll never see when you only use it to follow a bunch of old college friends. Should those things be downloaded as needed? Maybe. But it would have a negative impact on metrics: if "New Feature X for Latin American Teenagers" takes 30 seconds to start up, it's not going to take off. It's easier when everything is already there. Besides, the effort of rearchitecting a 491MB app would be crazy. Of course Facebook has major public initiatives like React Native which could eventually allow parts of the native apps to be dynamically downloaded more easily (I don't know anything about whether that's planned, just stating the obvious).
- adtac 8y agoI don't know if this qualifies, but aren't there strict restrictions on bypassing the AppStore for updates? Would downloadable binary blobs (code logic, not assets) like this be allowed by Apple?
- pavlov 8y agoI think (not 100% sure, I don’t work actively on iOS apps anymore) that Apple’s current policy is to allow code downloads if they are executed on an OS-provided runtime. That means JavaScriptCore in practice, and React Native passes that bar.
- DerekL 8y agoSince June 2017, an app can also run the downloaded code on its own interpreter, and it can be any language, not just JavaScript.
- chris37879 8y ago
- underwater 8y agoThe Facebook app includes a massive amount of functionality. Open up the hamburger menu and you’ll see a subset of what it does: feed, groups, profiles, video, marketplace, events, camera app, search, crisis response, etc. Each of these has a very deep level of functionality. Facebook are also very data driven, which means they’re probably testing multiple versions of most features at any given time. Each of the products is implemented by their own team. I wouldn’t be surprised if there are literally thousands of engineers commuting changes to the iOS app on a regular basis. If you are on a small team you can make a lot of headway against bloat on your own. For an app like Facebook it would be incredibly difficult to understand the entire thing, let alone make much of a difference. Technologies like React Native are supposed to address bloat. It’s much more efficient to ship incremental features in JS (can even be done over the network), but React Native doesn’t solve every use case, and Facebook has a lot of legacy code.
- gnu8 8y agoFacebook doesn’t NEED any of that. I wish I worked there so I could rip all of that shit out of there and cut the whole company down to its proper size.
- hs86 8y agoMay I add a follow-up question? Why is their Android app 'only' 70MB? Are there fundamental differences between Android apks and iOS application bundles that cause these size differences? It seems to be a pattern that iOS apps are just bigger: - Facebook on Android is 70MB while on iOS it is 491MB - Twitter on Android is 74MB while on iOS it is 178MB. - Spotify on Android is 104MB while on iOS it is 164MB. - Dropbox on Android is 112MB while on iOS it is 228MB.
- perteraul 8y agoSwift bundles?
- anothergoogler 8y agoThat was my guess also, Swift apps are much heavier.
- saagarjha 8y agoFacebook is all Objective-C++, if I recall correctly.
- LegNeato 8y agoYes, Android has apk splitting ( https://developer.android.com/google/play/publishing/multiple-apks https://developer.android.com/google/play/publishing/multipl...), which enables different packages for different devices. This means an mdpi arm6 device in India doesn't need to download and install a package with xxhdpi assets and arm7 code, leading to a smaller effective package for each user. Also note that both platforms do delta updates but generally show the total size in the UI. So every update you aren't actually downloading that much over the wire. Source: I used to manage the Android and iOS release engineering teams at Facebook
- saagarjha 8y agoiOS has app thinning, which does essentially the same thing. However this only reduces the app size a bit, since most of the actual size comes from the app binary which is shared across devices.
- rado 8y agoNo, it's actually 0 MB since I deleted that bloated ____.
- Const-me 8y agoBecause they don't know how to develop software. At least not desktop/mobile software. A Windows CAD/CAM app I've developed, with very advanced algorithms and visuals, takes about 300k lines of code (45% C++, 45% C#, 10% others), has 3.7MB download size. That 3.7MB installer includes both 32 and 64 bit binaries. Couple general things how to achieve that. Be very conservative about third-party libraries. Not only they inflate size, you have to support every line of third-party code you've brought to the project. Prefer vector graphics over raster, and you'll get hi-dpi support for free. Stuff like XML or DDS can be compressed by 50% or more, other stuff like JPG or PNG is almost in-compressible. Distinguish these 2 resources, compress first with e.g. gzip but not the second it'll be a waste of CPU bandwidth.
- zwily 8y agoOf course they know how to develop software. They just don’t have a goal of a small app bundle size.
- Const-me 8y agoMy client (if I worked in that company he would be my manager) didn't care about installer size either. I did. I think it's about developer professionalism. If you have business goal to make small bundle but don't have professional developers who understand what I wrote in previous comment, it won't be small.
- retrogradeorbit 8y agoYep. Connections are fast, bandwidth is cheap and storage is capacious. Developers on the other hand are expensive.
- Amezarak 8y agoEveryone I know is out of space on their phones.
- orf 8y agoDevelopers of an app used by over a billion people do not know how to develop software because you wrote a small CAD app one time? Right. I think someone should reach out to them and let them know that they just have to gzip their XML!
- octosphere 8y ago> How is Facebook's iOS app 491MB? Simple - Feature Creep[1]. Facebook's iOS app shows no restraint when it comes to features. Take for example when you have the word 'congratulations' in your status, when you then click on the word after posting it we are shown a big elaborate animation. Something like that may be at least 10MB of code - just for a silly animation. [1] https://en.wikipedia.org/wiki/Feature_creep https://en.wikipedia.org/wiki/Feature_creep
- twtw 8y ago> Something like that may be at least 10MB of code - just for a silly animation. For reference, the Linux kernel can easily be made to fit in 10MB. I don't understand how it can possibly be code, it has to be assets.
- harrygeez 8y agoall those layers of abstraction where JS is translated into native calls should take up some considerable weight. I believe they use a variation of React Native to share code between their Android and iOS apps. Magic always comes with a price
- captainmuon 8y agoI still don't understand it. WeChat, the Chinese messaging app, is the definition of feature creep, and still "only" 290.1 MB. It not only includes messaging and social network functions, but banking, shopping, taxi hailing, dating, and tons of other features. It's been compared to an OS of its own, you don't live in iOS or Android, you live in WeChat. I think it is a combination of not caring - everybody working at FB has the newest phone and the fastest connections - and maybe not the best developers. Or maybe the developers are really top notch 10x developers that you would expect at a silicon valley megacorp, but they are incentivised wrong and have to push out new features as quickly as possible...
- jtokoph 8y agoAs far as I can tell with my limited use of WeChat while in China, most of the extra features are created by third parties and are hosted as third party web apps inside of a web browser. I could be wrong though.
- kondro 8y agoDoes this mean you have to be on WiFi the first time you download it because it’s over 150MB? Wouldn’t this potentially restrict themselves from anyone who’s phone is their primary computing device and don’t bother to have home internet? Differential updates are pribsbly much smaller.
- kjullien 8y agoThey released Facebook Lite for this reason I believe it's like 10 MB. Tried it but could not keep using it because it has no Authentication Code Generator... Which seems like a pretty big oversight if you ask me, but who cares I'd much rather watch Facebook slowly fade away in the meantime.
- forgot-my-pw 8y agoFacebook Lite is 1.3MB for my phone. It doesn't seem to be available for ios? https://itunes.apple.com/ca/developer/facebook-inc/id284882218?mt=8 https://itunes.apple.com/ca/developer/facebook-inc/id2848822...
- kup0 8y agoI am also very confused by this. Just a few months ago it showed as requiring 215MB on my iPhone. An update from this week shows 515MB (which is what the size is listed as in the app store as well). How did their app balloon nearly 2.5x in size in such a short time- with no noticeable change in the app itself?
- codesternews 8y agoThe below links provide great analysis of facebook app. They have ridiculous long class and method names. I have seen many classes which are too long. Most of the app space took by these strings and third party libraries etc. Some thing like this can be seen in whole code base: `NTNativeTemplateHackyWorkaroundBecauseNSMapTableIsBuggyContainer` https://blog.timac.org/2016/1018-analysis-of-the-facebook-app-for-ios/ https://blog.timac.org/2016/1018-analysis-of-the-facebook-ap... https://blog.timac.org/2017/0410-analysis-of-the-facebook-app-for-ios-v-87-0/ https://blog.timac.org/2017/0410-analysis-of-the-facebook-ap...