201 points · by x0054 · 8y ago · 156 comments
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).
What could have added 300MB to the total so quickly?
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.
Just use the mobile site with safari. It’s blazing fast and doesn’t slurp your address book or location and drain your battery.
[1]: https://github.com/indywidualny/FaceSlim
(Only on Android though...)
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.
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.
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.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
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.
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.
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.
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...
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.
[0]: "App thinning" https://developer.apple.com/library/archive/qa/qa1795/_index...
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.
This 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().
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.
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.
I think someone should reach out to them and let them know that they just have to gzip their XML!
BTW I’ve wrote much more than 1 app in my life, I’ve been programming for living for 18 years already. Mostly desktop software, some mobile, videogames, and embedded. I haven’t developed web apps but I’ve interacted with many people who did, I think they have slightly different mindset, the areas are just too different.
What I think might have happened, FB hired people based on the criteria dictated by their main product, facebook.com web site, then told them to write that iOS app.
And you should definitely not postulate on their ability to develop software based on that utter lack of knowledge.
Absolutely nothing.
I think the more accurate way would be that scale has absolutely everything to do with it, from the way you develop your systems at the very lowest layer (architecture, code layout, optimisations) to the very highest (the UI).
Designing software for 1,000,000,000 users is an entirely different ballpark than for 1,000. Different trade offs, different restrictions, different everything.
There is a reason Google had to invent their own freaking database (using atomic clocks to handle transactions no less) to get to their scale, and it's not because they were a bit bored and fancied giving it a go.
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.
Because it's not an important constraint to them.
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.
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)
It doesn't seem to be available for ios? https://itunes.apple.com/ca/developer/facebook-inc/id2848822...
`NTNativeTemplateHackyWorkaroundBecauseNSMapTableIsBuggyContainer`
https://blog.timac.org/2016/1018-analysis-of-the-facebook-ap...
https://blog.timac.org/2017/0410-analysis-of-the-facebook-ap...
How did their app balloon nearly 2.5x in size in such a short time- with no noticeable change in the app itself?
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.
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
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.
And that's not just theoretical: I have 16GB and I'm always scraping for storage
That whole line of reasoning is just antisocial laziness. You pay for it so I don’t need to bother.
Not many these days; the last iPhone that shipped with this configuration was the 5c four years ago (I had one; 8 GB sucked).