Precious Bandwidth

Warning: Extreme nerd content.

View source on just about any Google page and you’ll see most of the code jammed together on a single line. With the kind of volume they do, every byte saved adds up to real money, so removing line feeds saves dough. But if they’re being that careful about conserving bandwidth, how does Google Video figure into the equation? Thought it might be fun to do some cocktail napkin math.

If I run a Google search and save the source code to a file, that file is 24032 bytes. If I open it in BB-Edit and run Format | Plain (which adds line breaks at logical places but adds no indentation), the file grows to 26868 bytes*. So Google is saving an impressive 2836 bytes (2.8k) per SERP by removing line feeds.

Now, assume a video stream that runs at around 2MBs/minute and lasts three minutes. At 1048576 bytes per MB, that’s 6,291,456 bytes per video stream. Which gives us a ratio of:

6,291,456 / 26868 = 2218.4 / 1

So the precious bytes Google saves by removing line feeds on 2,218 SERPs is nullified by serving a single three-minute video. Of course, they dish up a hell of a lot more SERPs than videos, but it does raise the question: Is bandwidth precious to Google or not? I can picture the looks on the faces of all the engineers who had spent a decade living under the “Optimize the hell out of it” mantra the day they learned the company would be serving up unlimited gobs of video to the public for free.

Update: Sean observes that some of the videos he’s downloaded from Google average 6 MBs/minute, which would pretty much exactly double my estimate. We would need to download a bunch of videos from Google to get an accurate average, but if they’re averaging 6MBs/min, it makes me think that very little optimization is going on in Goog’s video dept. I train students to compress video at around 3 MBs/minute (320×240, 15fps, MPEG4). Since I was assuming that Google also has a strong interest in video optimization, I originally assumed that their streams would be of a similar size.

* Incidentally, if I run Format | Gentle Hierarchical at this point (which adds common indentation for nested elements), the file swells to 43356 bytes. And if I run Format | Hierarchical (which indents aggressively), the file swells to 64102 bytes — almost 3x its original size. Yow!

Technorati Tags: , ,

7 Replies to “Precious Bandwidth”

  1. This is really a false question. They can be efficient serving up searches and still deliver images and video.

    And your 2MB/s estimate is low.. I downloaded two 47 minute videos (Richard Dawkins’ “The Root of all Evil”, about religion) and they are 265.7 and 297.6 MB.

  2. This is really a false question. They can be efficient serving up searches and still deliver images and video.

    Sure they can do both. And within their respective domains they can do both efficiently – I didn’t say they couldn’t. I just think it’s amusing that a long history of such aggressive optimization on one side of the business is so grossly offset by the inherent nature of  another side of the business.

    Thanks for the figures on your downloads – I’ll update the figgers based on those.

  3. We used to run our HTML code all together like that at the first online service where I worked. Not so much to save money, but because this was back in modemtime and we wanted to improve pageload/user experience by whatever fractions of a second we could pull off.

  4. I just think it’s amusing that a long history of such aggressive optimization on one side of the business is so grossly offset by the inherent nature of another side of the business.

    Well, I see what you are trying to get at, but I still think it’s a strange perspective. I’m sure Google is doing everything in their power to optimize whatever content they are delivering, whether that be HTML, images, or video. I’d be surprised if they didn’t have staff dedicated to researching and developing codecs to shave off bytes where they can.

  5. I train students to compress video at around 3 MBs/minute (320×240, 15fps, MPEG4).

    And BTW, those videos I cited earlier appear to be 640×480, which might go to explain why the bitrates need to be higher..

Leave a Reply

Your email address will not be published. Required fields are marked *