Slashdot Mirror


Google To Promote Web Speed On New Dev Site

CWmike writes "Google has created a Web site for developers that is focused exclusively on making Web applications, sites and browsers faster. The site will allow developers to submit ideas, suggestions and questions via a discussion forum and by using Google's Moderator tool. Google hopes developers will join it in improving core online technologies such as HTML and TCP/IP. For Google, a prime example of how Web performance can be enhanced is the development of HTML 5, which provides a major improvement in how Web applications process Javascript, Google believes. 'We're hoping the community will spend some time on the basic protocols of the Internet,' Google product manager Richard Rabbat said. 'There's quite a bit of optimization that can be done [in that area].'"

10 of 106 comments (clear)

  1. Why Do They Ignore Their Own Advice? by eldavojohn · · Score: 5, Interesting
    Most of this is helpful but from the HTML piece:

    HTML - as opposed to XHTML, even when delivered with the MIME type text/html - allows authors to omit certain tags. According to the HTML 4 DTD, you can omit the following tags (tags of so-called "void" - empty - elements are marked as strikethrough):

    • </area>
    • </base>
    • <body>
    • </body>
    • (Void Element) </br>
    • </col>
    • </colgroup>
    • </dd>
    • </dt>
    • <head>
    • </head>
    • (Void Element) </hr>
    • <html>
    • </html>
    • (Void Element) </img>
    • (Void Element) </input>
    • </li>
    • (Void Element) </link>
    • (Void Element) </meta>
    • </option>
    • </p>
    • </param>
    • <tbody>
    • </tbody>
    • </td>
    • </tfoot>
    • </th>
    • </thead>
    • </tr>

    For example, if you have a list of items marked up as <li>List item</li>, you could instead just write <li>List item. Or instead of a paragraph that you'd usually close with via </p>, you could just use <p>My paragraph. This even works with html, head, and body, which are not required in HTML. (Make sure you feel comfortable with this before making it your standard coding practice.)

    Omitting optional tags keeps your HTML formally valid, while decreasing your file size. In a typical document, this can mean 5-20 % savings.

    Now, my first reaction was simply "that cannot be valid!" But, of course, it is. What I found interesting is that when I looked at the source for that tutorial they themselves are using </li> and </p>. Interesting, huh? You would hope that Google would follow the very advice they are trying to give you.

    Some of these suggestions may come at the cost of readability and maintainability. There's something about web pages being nice tidy properly formatted XML documents with proper closing tags that I like.

    --
    My work here is dung.
    1. Re:Why Do They Ignore Their Own Advice? by gbjbaanb · · Score: 4, Interesting

      The trouble with web pages is that they are source and 'released binary' all in one file, so if you put comments in (as you always should), and meaningful tag and variable names, then your download gets quite bigger.

      What you really need is a system to 'compile' the source pages to something less readable, but significantly smaller - removing comments, replacing the unneeded end tags, shortening the variable names. If that was automated - so your source files were deployed to the server via this translator, then you'd never even know the difference, except your users on low-bandwidth (ie mobile) devices would love you more.

      We used a primitive one many years ago, but I don't know if there's any improvements to the state of web-page optimisers today.

    2. Re:Why Do They Ignore Their Own Advice? by Serious+Callers+Only · · Score: 5, Informative

      What you really need is a system to 'compile' the source pages to something less readable, but significantly smaller - removing comments, replacing the unneeded end tags, shortening the variable names. If that was automated...

      Something like gzip compression perhaps?

    3. Re:Why Do They Ignore Their Own Advice? by Anonymous Coward · · Score: 3, Informative

      This is what's called mod_deflate on Apache 2

      I'm using it on a couple small sites I maintain. The text portions of those sites get compressed to less than 50% of their original site. Obviously it does not compress images, pdfs,...
      Obviously there is no need to compress those as they are already properly prepared before they are available online.

    4. Re:Why Do They Ignore Their Own Advice? by BZ · · Score: 5, Informative

      > The price of downloading html and javascript source is peanuts compared to images and
      > flash animations

      That may or may not be true... Last I checked, a number of popular portal sites (things like cnn.com) included scripts totaling several hundred kilobytes as part of the page. The problem is that unlike images those scripts prevent the browser from doing certain things while the script is downloading (because you never know when that 200kb script you're waiting on will decide to do a document.write and compeletely change what you're supposed to do with all the HTML that follows it). So the cost of downloading scripts is _very_ palpable...

    5. Re:Why Do They Ignore Their Own Advice? by quanticle · · Score: 3, Insightful

      The problem with gzip compression (in this case) is that its not lossy. All of the "unnecessary" things that you have (e.g. the unneeded closing tags on some elements) will still be there when you decompress the transmitted data. I think the grandparent wants a compression algorithm that's "intelligently lossy"; in other words, smart enough to strip off all the unneeded data (comments, extra tags, etc.) and then gzip the result for additional savings.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
  2. Revolutionary idea by fph+il+quozientatore · · Score: 5, Funny

    I have this great and innovative idea. Take your browser-based e-mail client and word processor, rewrite them in native machine code and run them alongside the browser, as a separate app, instead of inside it. For even more speedup, the data could be stored on the hard drive instead of downloaded from a remote web-site. Never seen before!

    --
    My first program:

    Hell Segmentation fault

  3. external resources in HTML pages by reed · · Score: 3, Insightful

    The number one slowdown I see on pages is linking to all kinds of external resources: images, flash movies, iframes, CSS, bits of javascript. Each of these requires at least another DNS lookup and a new HTTP connection, and often those external servers take a really long time to respond (because they're busy doing the same for all those other websites using them). Why is this going on in each users browser? It should all be done behind the scenes on the web server. Why would you put the basic user experience of your users or customers in the hands of random partners who are also doing the same for competing sites? It takes some load off your server, but I think the real reason that people just link in external resources as images, objects, etc is just that it's easier than implementing it in the back end. If you really want to offload work, then design a mechanism that addresses that need specifically.

    We've ended up with a broken idea of what a web server is. Because it was the easiest way to get started, we now seem to be stuck with the basic idea that a web server is something that maps request URLs directly to files on the server's hard disk that are either returned as is or executed as scripts. This needs to change (and it is a little bit, as those "CGI scripts" have now evolved into scripts which are using real web app frameworks.)

  4. Re:Start by eliminating the zero bits by Tokerat · · Score: 3, Funny

    Yes, the 1s are skinny and the 0s are fat. You see, there is more space to compress between a line of evenly spaced 1s than between a line of evenly spaced 0s. If you compress wth too much force, the 0s get "squished", they'll turn into 1s, and this can screw up the formatting and cause segfaults and kernel panics, even in the newer Linux builds. There isn't much that can be done about this, even with today's protected memory designs, so we're limited to removing the space in between. It might help you to think of this technique as the giant laser thingie in "Honey, I Shrunk The Kids!" which recuded the space between atoms of objects in order to shrink them.

    ROR compression (a variation of the .rar format) uses this particular method, replacing the 0s with a counter of how many 0s in a row where replaced, and then compressing the 1s together. This is called "Packed Binary Coding".

    Similar methods where developed by American researchers (Dynamic Unicode Hypertensioning), but instead of simply compressing the 1s, they are instead converted into a pipe character ("|") so as to prevent the tick mark adorning the shaft of the 1 to prevent further compression (or errors resulting from "tilt" when the ones are pressed together too forcefully).

    These are second-year Comp Sci concepts. What is /. coming too when we're not even keeping up with the basics? It's a sad day for geeks everywhere.

    --
    CAn'T CompreHend SARcaSm?
  5. Re:Some very slow sites: Slashdot and Facebook by WebmasterNeal · · Score: 3, Interesting

    Look at these lovely stats from my Facebook profile:

    Documents (3 files) 7 KB (592 KB uncompressed)
    Images (111 files) 215 KB
    Objects (1 file) 701 bytes
    Scripts (27 files) 321 KB (1102 KB uncompressed)
    Style Sheets (12 files) 69 KB (303 KB uncompressed)
    Total 613 KB (2213 KB uncompressed)

    --
    "During My Service In The United States Congress, I Took The Initiative In Creating The Internet." -Al Gore