Live data from Hacker News

A single tweet page is 2.0 MB

mike.teczno.com

101–110 of 115 posts

Re: A single tweet page is 2.0 MB

#101
post #3

His rant doesn't seem too informed: "aggressive anti-performance and apparent contempt for the web by Twitter’s designers" According to his charts most of Twitter's page is JS/CSS and presumably set to heavily cache. Very little is data. Once you've done the first page load Twitter's pages will load quite fast and efficiently. While quite a lot of JS, this is good design, not bad.

Did you know, gmail's entire web app is 1.66 megs once fully loaded? Users visit it many times every day and they've still optimized the hell out of it. Same goes for many other well built web apps. Twitter has been getting away with sloppy engineering since their inception and yet they continue to give others engineering advice.

It's also worth noting that you load gmail's web client to interact with an entire inbox full of mail, sending, receiving etc.

The point of the OP is that a user is loading 2 megs to view a single tweet. A medium that is literally defined by its brevity, should not need to send 2 megs to your browser so that you can read 140 characters.

Re: A single tweet page is 2.0 MB

#102

The first tweet is 2 MB. How much is the second?

The point is that when the first tweet is 2MB, I never get to the second tweet. I stopped opening links to tweets recently because it was unbearable to wait for the page to load. What person at twitter thinks it's reasonable for me to spend more time waiting for a 140 character message to load than it takes to read it?

Re: A single tweet page is 2.0 MB

#103

All of the comments here could be shortened to "It's cached so it doesn't matter" as if the main problem was "2 MB is too large hence loading is too slow". But the problem here (according to the author and I tend to agree with him) is that one needs to load too much junk for too little actual content; whether the junk in question is cached or not. Now, ideally, a tweet's 140 characters shouldn't weight 2 MB but Twitt…

A retweet is just a post request. A follow this person is a post request. Those can both be done with a simple HTML form.

If you give the browser a form, it's going to want a callback(JS); to make sure everything went through. When you give it the callback, it'll probably ask you for a image; pretty UIs are important. When you give a browser an image, it'll need to be styled(CSS). . . and so begins the theory of "If you give a browser a cookie".

Granted 2MB is pretty big, but the only people I see complaining are techies; valid complaints but do not effect Twitter's bottom line.

Re: A single tweet page is 2.0 MB

#104

Several people in this thread state "It's cached, so why does it matter?" So, even ignoring the issue with cold caches, how about the two megabytes of code that the browser may need to go through to render the page? What on earth is twitter doing on a given page that needs two megabytes of code?* * As of March 2012, for I'm sure this will look silly when there are 2 gigabyte pages, 20 years from now.

I don't think we'll have 2 gigabyte codebases..

Higher resolution displays, bump/texture maps for live 3D rendering, 8K video, etc could all contribute to huge page sizes.

Re: A single tweet page is 2.0 MB

#106
post #52

Earlier quoted context omitted.

That is not entirely true. If you are authenticated your home_timeline is embedded in the page for instant rendering. Once Twitter moves away from #!'s individual tweets will be embedded as well.

Twitter is heavily optimized for multi-requests. The first is big (analogous to downloading an application) while every other request is miniscule in comparison. Hell, fetching tons of data from someone is tiny because its data only, not JS/CSS/etc

"Twitter is heavily optimized for multi-requests " - Which turns out to not be a very good idea, because it means that clicking on links from other sites to Twitter results in a huge performance hit - even if my browser has cached the assets, it still takes several seconds to execute all of that JavaScript, paint the CSS etc.

Re: A single tweet page is 2.0 MB

#107
In Q1 2007, my husband and I were invited to Twitter HQ for a meeting -- I was pitching a visualization project, my husband (renowned JS developer Thomas Fuchs) was proposing that we fix their horrible front-end performance issues (both page load & laggy JS code). We met with ev, some of the team, and the new CTO at the time. They nodded and agreed it was important. It would only take about 2 days of consulting. They later said "We can't get it together to hire you." Not due to the money (only a few grand, really), but about what you might call "political will."

Their front-end performance situation has sadly never gotten better… and has definitely gotten worse.

We started to build the visualization project anyway, and it got us a little bit of fame and a lot of consulting work: http://twistori.com

And just under a year later, we published a book on front-end performance: http://jsrocks.com

But I still wish we could have fixed their damn front end. Every time somebody tweets a link to a tweet and it opens up as a web page on my iPhone and I have to watch a blank screen for 10 freaking seconds before the tweet actually shows up, I die a little inside.

This story amuses & horrifies people who believe that startups are more flexible, responsive, & sane than big companies. At this time, Twitter the company was definitely smaller than 30 people… around 15 if memory serves, but I'm not sure. It was definitely small, either way. Meanwhile Twitter the site was growing in popularity by leaps & bounds every second. I'm sure the bandwidth saved alone would have paid back our consulting fees in a matter of a few weeks, or less.

Re: A single tweet page is 2.0 MB

#108
post #17

Earlier quoted context omitted.

Honestly, Facebook's load time is quite phenomenal. It is one of the most feature-laden and complex consumer web applications out there and they still manage to set the bar with regards to speed and multi-platform usability.

I've often thought this too. I wonder if it's because of HipHop https://developers.facebook.com/blog/post/358/

HipHop affects server-side performance, but the fast loading is down to some very clever usage of JavaScript.

I can't find a write-up about it now, but last time I dug in to it they were pulling a really clever trick where their pages were served with a very light chunk of HTML (just enough to layout the page) followed by a sequence of script blocks that populated different areas. The magic is that the script blocks came back in the order in which the relevant back-end services replied - so if the timeline service replied instantly, the timeline would be rendered first - then as other services (notifications, app list, etc) finished new script blocks would be written out in to the HTTP stream already open to the browser and that content would appear.

This works amazingly well across all browsers, because the original browsers from the 1990s were designed with modems in mind and had to progressively render the page as it loaded. It turns out you can use that ability to serve a stream of script blocks to a page and dramatically reduce time-to-content-visibility.

Re: A single tweet page is 2.0 MB

#109

The web will be a better place once everyone has 100mbps and servers have 10gbps. Sites like the verge can load in one second without caching.

The popularity of mobile devices for browsing (or tethering) means that for the first time in the Web's history the amount of available CPU and bandwidth has been going down, not up, for a huge chunk of users.

Re: A single tweet page is 2.0 MB

#110
post #106

Earlier quoted context omitted.

Twitter is heavily optimized for multi-requests. The first is big (analogous to downloading an application) while every other request is miniscule in comparison. Hell, fetching tons of data from someone is tiny because its data only, not JS/CSS/etc

"Twitter is heavily optimized for multi-requests " - Which turns out to not be a very good idea, because it means that clicking on links from other sites to Twitter results in a huge performance hit - even if my browser has cached the assets, it still takes several seconds to execute all of that JavaScript, paint the CSS etc.

It takes several seconds? How fast is your computer? I primarily use Twitter's web interface and it never felt slow compared to anything else, but then I run Chrome on a 2010 MBP, so I can imagine it would be slower on older hardware and browsers.
Post reply on HN