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?
158 comments
[ 2.7 ms ] story [ 229 ms ] threadThis was gold:
@interface FBSearchModule : FBNativeAppModule_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
Somehow it me feel better about the things I produce.
Heck, I've got a debugging routine I use on one of my projects that's called panic_on_the_streets_of_london().
Just use the mobile site with safari. It’s blazing fast and doesn’t slurp your address book or location and drain your battery.
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.
Pro Tip: if you need messenger on mobile, set your browser to "desktop site" to avoid facebooks insistence on installing its spyware pile of poo.
[1]: https://github.com/indywidualny/FaceSlim
(Only on Android though...)
[0]: "App thinning" https://developer.apple.com/library/archive/qa/qa1795/_index...
[1]: https://imgur.com/a/lTJhMbx
Edit: sorry, just saw you're not the person I replied to.
App thinning does not compress the app; it just pulls out stuff that doesn’t match the device the app is being installed on. And keep in mind that most application binaries are far from random data.
https://imgur.com/a/VwkFvxg
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.
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.
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”.
I'm simply "speculating" that a large number of reimplemented classes might not be the reason for the increased binary size from anecdotal experience of building similar app binaries for iOS.
FWIW, I think this comment gives a pretty good reason for why the binary size is large - https://news.ycombinator.com/item?id=17996161
Legally, if you are in the USA (or some other country surrounded by water) get on a boat, take it 5-10 miles out, and start (also when on a flight over an ocean would give you some coverage).
The comment you referred to (thank you) makes perfect sense.
I have never signed a contract with Facebook. Does that mean I’m free to reverse engineer it?
I thought this was 'hacker' news not 'let us study the click through EULA and respect the terms and conditions entirely' news.
If you can't or won't reverse engineer a binary file, you're a share cropper not a computer owner.
The real answer is that Facebook does A LOT. Especially the main app. Facebook also serves A LOT of different audiences in a lot of different regions.
Just consider that there is an entire YouTube worth of functionality inside of the main Facebook app. And that's just one vector of functionality that they offer.
They're predominately right out of school and don't understand systems engineering. If single schizophrenic man can create a complete 64-bit real-time multitasking operating system that can be distributed completely in a 2MB distribution, one of the highest valued tech companies in the world can make a glorified version of their website fit in under 20MB.
Think how many lifetimes are wasted each day waiting for Facebook to load or update.
I just uninstalled it about a year ago because I was so disgusted with it. Now, I get ads begging me to come back.
The late Terry A. Davis.
Because it's not an important constraint to them.
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.
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)
And that's not just theoretical: I have 16GB and I'm always scraping for storage
Not many these days; the last iPhone that shipped with this configuration was the 5c four years ago (I had one; 8 GB sucked).
That whole line of reasoning is just antisocial laziness. You pay for it so I don’t need to bother.
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).
2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps.
Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the Application completely viewable and editable by the user.
https://developer.apple.com/app-store/review/guidelines/
Is it even that? The Facebook app’s UI is sufficiently different than the standard system controls that it seems to me that they might be completely custom.
What could have added 300MB to the total so quickly?
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.
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:
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
https://help.apple.com/xcode/mac/current/#/devbbdc5ce4f
Not to be rude, but you are literally talking to someone who was in charge of this, looked at the graphs daily, and made the call when we went over the OTA limit on iOS. When I say multiple-apks are a large reason for the discrepancy, you should give me the benefit of the doubt. It's not the only reason mind you.
As far as I was aware, the comment you were responding to was broadly accurate, but now I don’t know and have no additional information.
Christan Legnitto, working at FB on release engineering, see his submission of this article in 2013.
Your original claim was that OP needed to substantiate their credentials; it was done (regardless of who).
HN Guidelines suggest we reply to the strongest argument being made and to give the benefit of the doubt, and that doesn't seem to be your approach.
Edit: I can't believe I'm defending FB or anyone that caused their increase in usage.
Its purposely designed that way to encourage conversation. Its not like at work where you may fear challenging someone at a higher level than you.
Ouch. Hope this isn’t how you managed your teams.