
Ask HN: How is Facebook's iOS app 491MB? - x0054
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?
======
pavlov
I 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).

~~~
CodeWriter23
Are you saying after a month there, you’re sure it’s not just a bunch of
unused legacy code that engineers are smart enough not to delete because
they’re not really sure what it does and the original authors have cashed out
and are kickin’ it counting their money? Especially all that Objective C
they’ve been madly trying to pave over with Swift?

~~~
rootsudo
Well, there is also facebook lite.

------
tbrock
Facebook 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.

~~~
qrbLPHiKpiux
Uninstalling it is the best thing you can do for YOUR life!

~~~
emsy
The fact that so many people on HN, people who should know the best how
malicious this company and their business model is, are still using FB is
worrying. How are normal people supposed to quit?

------
hs86
May 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.

~~~
LegNeato
Yes, Android has apk splitting (
[https://developer.android.com/google/play/publishing/multipl...](https://developer.android.com/google/play/publishing/multiple-
apks)), 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
iOS 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.

~~~
LegNeato
App thinning is not the same and not nearly as effective.

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.

~~~
slededit
In a pseudo-anonymous forum you must provide facts - not rely on credentials.
The answer to your “Do you not realize who I am” post is No, we have no idea.

~~~
ncr100
[https://m.facebook.com/notes/facebook-engineering/update-
on-...](https://m.facebook.com/notes/facebook-engineering/update-on-the-
facebook-for-android-beta-testing-program/10151729114953920)

Christan Legnitto, working at FB on release engineering, see his submission of
this article in 2013.

~~~
slededit
Comments should stand on their own. Nobody learns anything with a “because I
said so - just trust me” comment.

~~~
18pfsmt
This a text book example of moving the goal posts, and I don't care to see it
on HN. Android obviously allows more freedom to app developers than Apple,
including the freedom to raid the cookie jar numerous ways.

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.

~~~
slededit
No, you misunderstand the whole point. Credentials don't matter in an
anonymous setting. That's the whole point, people can converse on equal terms.
The only "credentials" in common display is whether or not your account is
new.

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.

------
underwater
The 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
Facebook 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.

------
octosphere
> 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)

~~~
captainmuon
I 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
As 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.

------
firloop
Keep 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...](https://developer.apple.com/library/archive/qa/qa1795/_index.html)

[1]: [https://imgur.com/a/lTJhMbx](https://imgur.com/a/lTJhMbx)

~~~
deanCommie
That's not a significant difference...

~~~
adtac
Tbh 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
Please, it’s a big drop in terms of percentage, but it’s absurdly large for
what the app does.

~~~
adtac
Oh I completely agree it's bloated as fuck, but your statement that it's not a
significant decrease is untrue.

Edit: sorry, just saw you're not the person I replied to.

~~~
verelo
No worries :) and yeah, i just don’t get it. I oversaw the development of a
high ranking app for the last 6 years and it was a massive focus of ours to
keep it small for as long as possible. We saw that conversion dropped as the
app grew, we assume as the size grew it encouraged people to wait for wifi or
their next months data before they would start the download.

~~~
toast0
Not so much for iOS as on Android, because Apple doesn't sell devices with
nearly zero space; some people are constantly out of space -- you don't want
to be listed high on sort current apps by size.

~~~
verelo
Our research indicated the issue was more around data transfer and access to
wifi, less around storage.

------
meguest
[https://blog.timac.org/2017/0410-analysis-of-the-facebook-
ap...](https://blog.timac.org/2017/0410-analysis-of-the-facebook-app-for-
ios-v-87-0/)

~~~
reaperducer
Thanks 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
Honestly I think it's funny and I appreciate a sense of humor from coworkers.

~~~
reaperducer
I'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().

------
jameslk
Unless 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
The 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
I 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
For 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.

------
Const-me
Because 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.

~~~
orf
Developers 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!

~~~
retrogradeorbit
What does number of users have to do with software development know how?

Absolutely nothing.

~~~
orf
Well, sure, thats one simplistic way of looking at it. Code is code.

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.

~~~
Const-me
> Designing software for 1,000,000,000 users is an entirely different ballpark
> than for 1,000. Different trade offs, different restrictions, different
> everything.

This is in part what I meant by different mindset.

For web developers, dealing with the complexity caused by massive scale is
inevitable, and yes, for them it’s different everything.

Desktop and mobile developers are essentially shielded from that complexity by
slow networks. It’s technically possible to VPN into DC and write mobile apps
as they were a server app, but even ignoring security considerations, this is
usually wrong approach. Within DC you have 0.5ms latency, over mobile Internet
it’s 200ms best case. These 2-3 orders of magnitude make great difference on
how you should design software.

------
zethraeus
Because 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.

~~~
sidcool
And there's Facebook Lite app.

~~~
kup0
Unfortunately not available in US iOS app store, though. Wish they would
provide it everywhere.

------
adtac
And 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.

~~~
vedtopkar
For reference, messenger.com is a standalone FB Messenger web app that works
great -- my use-case for FB is largely the same as yours.

~~~
adtac
How are you using messenger.com on mobile? I use it on the desktop, but on
mobile, the website just links to the app.

~~~
nasalgoat
If you select the Share option, one of the options on the bottom bar is
actually "Request Desktop Site".

------
dedalus
I 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
It 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.

------
Operyl
The 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
Yes, due to app thinning. But 300 MB is still an insane size for an app like
this.

~~~
Operyl
The app does a lot, it’s huge, it even has a built in live game show.

~~~
saagarjha
It also has something like 18000 classes in it, many of which are not used.
While it may do many things, most of the app is just bloat.

------
codesternews
The 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-
ap...](https://blog.timac.org/2016/1018-analysis-of-the-facebook-app-for-ios/)

[https://blog.timac.org/2017/0410-analysis-of-the-facebook-
ap...](https://blog.timac.org/2017/0410-analysis-of-the-facebook-app-for-
ios-v-87-0/)

------
kjullien
They 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
Facebook Lite is 1.3MB for my phone.

It doesn't seem to be available for ios?
[https://itunes.apple.com/ca/developer/facebook-
inc/id2848822...](https://itunes.apple.com/ca/developer/facebook-
inc/id284882218?mt=8)

------
amaccuish
I 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.

------
drdrey
Unless it's a KPI you won't get an OKR to address it

------
AsyncAwait
It probably is at least partially autogenerated, contains tons of legacy code,
code for different markets, code for yet unreleased features, NSA tracking
code...

------
smackfu
I’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.

------
kup0
I 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?

------
kondro
Does 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.

------
forg0t_username
I'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.

------
marczellm
I 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
They acquired a company a while back called Osmeta that basically
reimplemented parts of iOS.

------
rado
No, it's actually 0 MB since I deleted that bloated ____.

------
sidlls
They 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.).

~~~
plicense
I 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
> 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”.

~~~
plicense
I've not reverse engineered the FB app. I also don't think I'm legally allowed
to.

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](https://news.ycombinator.com/item?id=17996161)

~~~
HenryBemis
It is contractually you aren't supposed to, due to terms & conditions.

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.

~~~
saagarjha
> It is contractually you aren't supposed to, due to terms & conditions.

I have never signed a contract with Facebook. Does that mean I’m free to
reverse engineer it?

~~~
manquer
I guess he means the T&C you agree to when downloading the app from apple and
fb

------
jerkstate
iOS can't handle their scale

~~~
saagarjha
Nope, considering that their app loads fine on most iOS devices…

------
konart
All dem tracking hacks... Need to be sure.

------
40acres
Why does it matter? Modern smartphones have more than enough space.

~~~
williamdclt
Not 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

~~~
tinus_hn
16GB 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.

------
pvg
If 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'.

------
dsc_
Instead of complaining, how about you fetch the package and reverse engineer
it so you can answer your own question.

~~~
saagarjha
This is not possible to do without a jailbroken device, which not everyone
has.

~~~
wonthegame
You don't need to jailbreak in order to do that.

~~~
saagarjha
How do you remove FairPlay without a jailbroken device?

