6 ms·
> If you reload the page you’ll see approximately fifty-bajillion network requests go off as Facebook desperately tries to load all the junk that it needs to di
by BinaryIdiot 11y ago
> If you reload the page you’ll see approximately fifty-bajillion network requests go off as Facebook desperately tries to load all the junk that it needs to display facebook.com.
I like this part. As a developer I've often looked at the network usage of large websites / web applications and it's always surprising to me just how...unoptimized it is as far as network connections go.
I mean Facebook loads decently enough and all I'm just surprised the first load isn't condensed into a small, handful of network calls to save on latency.
- simonw 11y ago"I mean Facebook loads decently enough and all I'm just surprised the first load isn't condensed into a small, handful of network calls to save on latency." Actually it is: https://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919/ https://www.facebook.com/notes/facebook-engineering/bigpipe-...
- BinaryIdiot 11y ago> Actually it is: https://www.facebook.com/notes/facebook-engineering/bigpipe-.. https://www.facebook.com/notes/facebook-engineering/bigpipe-.... Nope. Did you read through how BigPipe works? It's more than a handful; they basically load a whole bunch of mini web pages inside of another. I'm actually impressed they get better performance doing that; I would have thought condensing everything down would net much better performance. It would at least improve latency but I digress.
- Kluny 11y agoYet somehow it's ridiculously fast... like, when I'm waiting for some other site to load, I almost automatically open facebook or hn in another tab, because I know those two sites will load instantly while pretty much everything else on the internet will take a few seconds.
- RussianCow 11y agoReally? The notifications and the first story show up fairly quickly for me, but everything else usually takes a few seconds. Certainly not terrible, but I wouldn't call it "ridiculously fast" either.
- madaxe_again 11y agoDon't get me started. The best thing I've ever seen is a site using Google tag manager to load an ad tag manager which loaded a different gtm instance which... Loaded the site's own js libraries. This horror out of time and space was beaten, shot and stabbed, and the developer responsible for its invention was promoted to CTO and King of the universe.
- cbhl 11y agoProgressive rendering and lots of small network requests can be good if the user feels its faster. I suspect their mobile apps are more conservative about using fewer requests (and probably a binary protocol).
- nommm-nommm 11y agoUnlikely. People report that uninstalling Facebook on their phones increases battery life by up to 20%.
- maccard 11y agoThe Facebook mobile app on iOS is awful - worse than their mobile website. It takes an age to load, drinks battery life, is massive, doesn't contain the messenger functionality (you need another 60MB app for that).
- grawlinson 11y agoGiven the age of Facebook and what you're describing, I can only assume that Facebook have just chucked fifty-bajillion interns (one after the other) at the source and told them to add more crap. I mean, isn't that how monolithic apps tend to happen? Someone leaves, new person comes along and adds more to the cruft.
- BinaryIdiot 11y agoI mean, honestly, that's almost exactly what they said they do with the mobile app and how it contains so many classes / objects that it's really incredibly the app still works. But I don't know anyone at Facebook so I have no idea how the website is handled.
- onewaystreet 11y ago> I like this part. As a developer I've often looked at the network usage of large websites / web applications and it's always surprising to me just how...unoptimized it is as far as network connections go. Have you considered that your opinion on the best way to serve data to a billion users might actually be wrong? That maybe Facebook actually knows what they are doing?
- CrystalCuckoo 11y agoThis is the company that bragged about having 18,000 classes for their iOS app [1] and having to patch the Dalvik Virtual Machine to support new features in their Android app [2]; they are not infallible. [1] http://quellish.tumblr.com/post/126712999812/how-on-earth-the-facebook-ios-application-is-so http://quellish.tumblr.com/post/126712999812/how-on-earth-th... [2] https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920/ https://www.facebook.com/notes/facebook-engineering/under-th...
- sbd01 11y agoIiRC they aso exploited an Android bug to give themselves more memory. Facebook is woefully buggy and slow that many people are now either using the website or alternative wrapper apps that don't drain their battery immensely.
- BinaryIdiot 11y ago> Have you considered that your opinion on the best way to serve data to a billion users might actually be wrong? That maybe Facebook actually knows what they are doing? Certainly! But I've also done work where Humvees in the middle of Iraq use satellite internet connectivity with massive latency and the more connections it has to open to get started the slower everything gets. Perhaps this is an advantage where latency is low so you can load parts of the page faster but I'd love to know some of the more technical reasons behind this!
- thewarrior 11y ago
- pavs 11y agoAs someone else have mentioned most of these connections are progressive connection. Another thing to consider is their CDN usage. Facebook uses Akamai as their CDN of choice, most large to medium size telco/ ISP has their own Akamai Cache server at their NOC. So latency is not issue for the big files (images and JavaScript) after the initial reload, assuming they are not cached on the browser already. So no matter how many connections are made when visiting facebook, it usually loads fairly fast because of aggressive caching and progressive connections. Most of the time the end user shouldn't be able to tell the difference.