6 ms·
Personally, I think the problem is people trying to be too clever, and loading too much content at once. Loading tons of JavaScript means that Facebook loads v
by TazeTSchnitzel 14y ago
Personally, I think the problem is people trying to be too clever, and loading too much content at once.
Loading tons of JavaScript means that Facebook loads very slowly on my phone on mobile internet. And what is it needed for? The most the JS needs to do is make a pop-down notifications panel, and do one or two AJAX requests to post comments and "like" items. Looking at the Network panel in Chrome, I see Facebook has pulled down 700KB of JavaScript. Why? How could they possibly need that much code?
Facebook also seems to think that sending full-size images down to my phone, instead of compressed previews, isn't a problem. No wonder the GPU memory is exhausted!
- 54mf 14y agoYes, I'm sure Facebook and their stable of developers just never thought of that. How silly.
- TazeTSchnitzel 14y agoI think Facebook do know what they're doing, but are perhaps putting energy into the wrong things. Using a ton of JavaScript to avoid ever having to load another page is a nice idea, but it ends up bogging down the client. Using a lot of abstractions away from the DOM makes things slow. An occasional page load is probably beneficial. I'm also unconvinced they can't scale down images server-side to make them more mobile-palatable.
- timpeterson 14y ago@TazeTschnitzel agreed, but then what would fb engineers do all day? they gotta "keep shipping"
- notatoad 14y agobecause they're a big company with a lot of staff, everything they do must therefore be "the right way"? That's a fallacy if i've ever heard one.
- eli 14y agoTrue, but it's incredibly easy to play "armchair project architect," when you don't actually know anything about how a project works or its requirements or constraints. Maybe this is a personal flaw, but I can't count the number of times I've looked at a project and thought "that's a stupid way to do it" only to later realize the problem is far more nuanced than I thought.
- brendanib 14y agoA large portion of that 700kb of js is for user-level analytics to track everything, which is fed back into everything from Ads to Page Insights to News Feed algorithms. There's a lot going on that has nothing to do with loading and displaying content.
- deleted 14y ago[deleted]
- 001sky 14y agoThere's a lot going on that has nothing to do with loading and displaying content. -- This is exactly the problem. for users, content is king.
- drstewart 14y agoJust because it doesn't deal with directly showing content doesn't mean it has nothing to do with content. Let's say Google used predictive algorithms based on what you've clicked/hovered on/looked at on the search page to generate your next query. That doesn't deal with loading and displaying content, but it is directly related to DECIDING which content is going to be shown. And if content is king, that's the most important thing of all.
- 001sky 14y agoException that proves the rule is google search. nobody wants to trade performance so they can be analyzed and ad-tracked "more better" for basic info...Example: 9x [!] do not track blocks @ http://www.independent.co.uk/ http://www.independent.co.uk/
- ryanwaggoner 14y agoI know it's in vogue to rail on Facebook at every opportunity, but you're making an assumption that all this tracking and analyzation is ultimately only to serve you more targeted advertising or sell your info. While that might be part of the reason, Facebook also does a lot of work behind the scenes to determine what content to show you, just like Google does. And while we're comparing Google and Facebook, why would it be ok for Google to analyze the heck out of your behavior but not for Facebook to do the same thing? Google and Facebook both make approximately the same percentage of their revenue (basically 100%) off of advertising, right?
- weixiyen 14y agoWhile that is a problem, it wouldn't solve the uncanny valley problem with scrolling either way. Standards for correct UI feel on iOS are extremely high, and you are looking at spending more development hours trying to create a write once run everywhere platform than just writing native code.
- TazeTSchnitzel 14y agoHuh? I'm talking mobile web, not HTML5-written faux-native apps.
- weixiyen 14y agoI see. Point still stands. Their timeline and newsfeed scrolling are still going to be problems regardless.
- TazeTSchnitzel 14y agoI'm unconvinced. Web pages scroll fine for me, why can't the timeline and newsfeed?
- fauigerzigerk 14y agoBecause it's infinite scrolling. They add stuff while you scroll. That's much more difficult to make smooth.
- TazeTSchnitzel 14y agoWhy can't they just load when you reach the end? I've found this tends to be what happens for me, anyway.
- aeturnum 14y agoThey could do that, but they don't want to. Their point is that web technologies can't deliver the experience they want. Telling them they want dumb things is not a legitimate response, especially as they can get the experience they want using other technology.
- ender7 14y agoIf the argument is that "you're using too much Javascript" then we all might as well just give up on HTML5 applications right now. Sure, we can break up our JS into modules that only get loaded on-demand (something that is quite hard to do, by the way), but eventually there will be lots of Javascript on the page. Because, you know, it's an app. Any app of decent complexity will involve a lot of code. By definition. (as far as image previews go, I agree, that's stupid. Especially given the performance concerns with large images on mobile browsers)
- TazeTSchnitzel 14y agoEh, I just find it hard to believe FB honestly needs that much just to load the homepage. Now, the whole mobile site? Sure, that seems reasonable, considering how much you can do. But if that's the case, I wonder why Facebook aren't modularising it.
- stcredzero 14y ago> If the argument is that "you're using too much Javascript" then we all might as well just give up on HTML5 applications right now. That doesn't follow. We'd only have to give up if you had to have that to display that amount of content. UX should come first. If you don't take care of your customer, someone else will do it for you.
- mikeash 14y agoIt seems like a matter of inadequate tools more than anything. When I write native code, I write apps that are broken up into relatively small chunks, which are then demand-paged off the disk when needed. A freshly launched copy of my app that hasn't touched most of its code takes up very little memory. And of course, all apps work that way, because that's how the system is built. It's actually substantially harder to avoid that lazy loading functionality than it is to take advantage of it. Obviously, the systems used to lazily load machine code stored locally are different from what would be needed to modularize and lazily load source code being loaded over the network, but surely there's some way to improve this without making programmers do a ton of grunt work. If pages are loading huge amounts of JavaScript code that goes unused simply because it's easier to code that way, doesn't that mean the tools are deficient?
- skybrian 14y agoIt's not all low-hanging fruit. The easiest way to pull in lots of code is make a library call. Libraries can depend on other libraries and how much gets optimized away is difficult to predict. Without good dashboards for watching the codebase and its effect on runtimes, it's easy to pull in too much. Profilers and other performance tools allow people to make rational decisions about when to cut back, rather than groping around in the dark.
- wamatt 14y agoMy experience of Facebook code is that it's bloated and convoluted, having been an evolution of hacks built on top of each other. In fact it feels similar to Microsoft and legacy code that where carried into Windows and beyond. Granted certain FB teams have developed some really cool stuff internally, and I'm just looking at their client side stack. But can't help get the feeling, they are just not thinking creatively about HTML 5 and mobile. Intuitively to me, 700kb seems excessive and could very probably be reduced. But even so, they could possibly break it up and cache 90% of that [1]. Or on demand loading (as others have suggested). Granted it needs to work across all platforms, but there are companies far smaller with fewer resources producing fast HTML5 apps for mobile. And if they doing that already, then I just can't understand how something relatively simple, (posting and browsing content), can perform so poorly. One doesn't need 700kb of analytics to know the experience sucks. ;) [1] http://stackoverflow.com/questions/5108376/how-do-you-cache-javascript-on-iphone-safari-using-html5-localstorage http://stackoverflow.com/questions/5108376/how-do-you-cache-...
- prostoalex 14y agoThis does not have to be a theoretical debate. Facebook content is available via their API. Most of the writes (liking, commenting, status updates, check-ins) are also available via API.
- Joeri 14y agoYou have to make a trade-off between simplicity and user expectations though. For example, 6 months before the iphone was released we developed a mobile app at my work that was universally compatible. It ran on the lowest WAP2 phone you could imagine, by virtue of not using any javascript, using nothing that wasn't in the XHTML basic standard, and putting few controls on each screen. And then the iphone happened and our users very vocally told us that the look and feel of this app was not acceptable. So, we built a version that runs only on modern smartphones and a very narrow range of browsers, but users are ecstatic about it, even though it does exactly the same things as before.