
Analysis of the Facebook app for iOS - Aaronn
http://blog.timac.org/?p=1707
======
LeoNatan25
This is really unacceptable and so easy to solve, had they even bothered.

But it has been known for years that Facebook just cannot (or will not) manage
its application development process. I remember reading somewhere that they
developed build tools that take multiple versions of the same static library
and mangle the symbols so that all versions can be linked into a single binary
and there are no symbol collisions - all this to allow developers to use
whatever version they started of, and god forbid, require some sort of review
or cooperation between developers.

It is very sad to me that so many companies (start up or otherwise) aspire so
much to have the same work methodologies as this company.

~~~
lazzlazzlazz
The fact that you think this third-party analysis has discovered an incredibly
easy way to radically reduce the size of the Facebook app - but that Facebook
has not "discovered" the same "fix" \- reveals an oversimplified perspective
of iOS, app development, and large tech companies.

I absolutely guarantee that this analysis is missing some significant
complexities, and that Facebook understands what's actually going on under the
hood.

~~~
threeseed
Has nobody worked on a decent sized, agile project before ?

Facebook updates their iOS app on a pretty regular cadence which means it is
quite likely that removing duplicate assets (if it's even an issue) could
simply have trickled across to the next sprint. You just can't make broad
generalisations based on a particular snapshot in time.

But I suspect it isn't even an issue anyway. It seems clear they have one
lightweight framework that is required during startup and another which gets
dynamically loaded later (FBNotOnStartupPathFramework).

~~~
LnxPrgr3
I did not buy 64GB of flash storage so Facebook could be lazy. I bought 64GB
of flash storage to store media that gets noticeably better, to a point, when
you throw more bits at it.

Things that are smaller than Facebook's iOS app:

\- Windows, through at least Windows 95, if you count stuff written to disk
during install

\- The Java Runtime Environment

\- Eclipse IDE

\- Google Chrome for OS X (beware—updater leaves old versions in the app
bundle)

\- Firefox for OS X

\- Pokémon Go

\- A two-disc set encoded in 256kbps AAC

And to add insult to injury, Messenger is another 155MB, and is a separate app
for some reason, probably with a second copy of that bigger-than-the-JRE-by-
itself FBSharedFramework.

And while the sudden almost 300MB is new, the "I can't believe this is a Web
service front-end and not an experimental operating system" bloat has been
with us for a while.

~~~
chii
> I did not buy 64GB of flash storage so Facebook could be lazy.

then vote with your wallet, and remove the app. If you can't tear yourself
away from facebook, the web is the "right" app to use!

~~~
CJefferson
Unfortunately, on android facebook purposefully disables parts of the website
(chat in particular) to force oyu to install the app.

~~~
noisem4ker
Chat can still be accessed through mbasic.facebook.com.

What other parts are disabled?

~~~
maccard
That's intentionally awkward. If I tap the messages icon on Facebook.com on
mobile, I get redirected to a page telling me to download the app. Similarly,
messenger.com points me to the App Store.

------
TorKlingberg
There must be a lot of people out there with 16GB iPhones that are constantly
out of space. I don't think Apple publishes stats, but I guess >50% buy the
cheapest model. The Facebook app also likes to use 500 MB for cache with no
way to clear it other than deleting the app.

~~~
jimboj
Lots of apps are like this and I don't understand why. They should be using
the caches folder and "the system may delete the Caches/ directory to free up
disk space". However I have never seen this happen. When my phone runs out of
space I have to manually delete these apps. Are they not using the correct
folder, or is the system not deleting the caches?

------
nagyf
Why do you have to download all localizations? Isn't it possible to download
only the required one after install? As far as I know Waze does this, for
example. (Honest question, I'm not a mobile developer)

~~~
ade2
Sure you can! Downloading the localizations is a large extra complexity in
development though, while simply bundling them all is a minor bother in
increased download size, for the customer.

------
coldcode
I thought our apps were fat, this is ridiculous. But clearly they belong to
the school of never rewrite just keep adding more and more and more.
Eventually you wind up having no idea what you are shipping and the quality
goes in the dumpster. At least you can use the web if you hate the mobile app
(I do).

------
tmsldd
This is a side-effect of the current app business model, which sacrifices
software quality to deploy it fast to the market... who expends 1 month
optimization while a new app comes every 6 months ?

------
bdrool
> DO_NOT_USE_OR_YOU_WILL_BE_FIRED

What could possibly be in there?

~~~
spicyj
We use it as a joke name for functions/modules that are deprecated or
dangerous, or that otherwise should be avoided. It works pretty well even
though it's (probably) an empty threat.

~~~
Spiritus
Why not just remove them instead?

~~~
tokenizerrr
The same reason why you otherwise deprecate stuff. Because it's still used. As
for React, they have such a variable to allow interop with the react dev
tools.

------
beezischillin
I find it fascinating that they managed to get to this much disk footprint so
soon without any of us having much of an idea about what is going on below the
good.

Despite weekly updates with nonsensical generic descriptions we still don't
have actual features like support for devices like the iPad Pro.

Especially with all the frequent A/B testing bull they're pulling recently,
the quality and usability of their software is dropping on a weekly basis. It
just seems like a bad combination of everything on a level Microsoft at their
worst couldn't even come up with.

------
enig_matic7
Is there a privacy analysis of the Facebook app that anyone knows about?

------
iamleppert
This is exactly what happens when you don't bother to have any coherent
architecture.

And is why you shouldn't get a job at Facebook if you really care about what
kind of work you do.

~~~
CoolGuySteve
The funny part is even if you do interview at Facebook, they only ask
algorithm whiteboard questions. So it doesn't really matter if you have the
sort of aesthetic values that cause this horrible app or not. If anything they
might be actively selecting for it by filtering out experienced hires.

------
azernik
Are these files not compressed on disk? I'd imagine duplicate data like this
compresses very well.

~~~
kevingadd
That's assuming the on-disk compression deduplicates. ZIP does not and 7z only
does in 'solid' mode. Compression is not a silver bullet for this either - if
you have a repeated 8MB sequence in 8 different parts of a 250MB file, whether
or not the sequence gets deduplicated depends on the compression algorithm,
dictionary size, speed setting, etc.

The solution to all the duplicated files is to dedup at build time.

------
rurban
New PM?

