Don't bother saving white-space

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephen Poley

    Don't bother saving white-space

    People in these groups, and on web-pages, not infrequently suggest that
    it is worthwhile cutting down on white-space and comments in HTML and
    CSS in order to reduce loading times. I and others have more than once
    doubted this, given the data-compression in the HTTP protocol. Having
    seen it suggested again a couple of times in the last few days, I
    decided it was time for a test on the effect of white-space.

    I took one of my pages:
    A checklist to run through before going public with your web-site. Many important points are overlooked by large numbers of web developers.

    which is 20 Kb.

    I then bloated it with whitespace to 162 Kb (nothing special about that
    number - it's just what it happened to end up as):


    I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
    ask - I don't know either) using Opera 7.

    The first page loads in 3 seconds, the second in 8 seconds - both
    figures seem to be repeatable. This suggests that if you took a file
    with a fairly generous 5Kb of white-space, and stripped out all of it,
    loading would be speeded up by a princely one-sixth of a second. (For
    comparison, the largest HTML file on my site, of 79Kb, turned out to
    have just under 3Kb of compressible white-space.)

    Somehow it just doesn't seem worth it ...

    --
    Stephen Poley


  • Neal

    #2
    Re: Don't bother saving white-space

    On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
    <sbpoleySpicedH amTrap@xs4all.n l> wrote:
    [color=blue]
    > People in these groups, and on web-pages, not infrequently suggest that
    > it is worthwhile cutting down on white-space and comments in HTML and
    > CSS in order to reduce loading times. I and others have more than once
    > doubted this, given the data-compression in the HTTP protocol. Having
    > seen it suggested again a couple of times in the last few days, I
    > decided it was time for a test on the effect of white-space.
    >
    > I took one of my pages:
    > http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
    > which is 20 Kb.
    >
    > I then bloated it with whitespace to 162 Kb (nothing special about that
    > number - it's just what it happened to end up as):
    > http://www.xs4all.nl/~sbpoley/misc/checklist.html
    >
    > I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
    > ask - I don't know either) using Opera 7.
    >
    > The first page loads in 3 seconds, the second in 8 seconds - both
    > figures seem to be repeatable.[/color]

    For me, original=3secs, bloated=21 secs.

    The extra white space amounts to 142 Kb. Took me 18 extra seconds to load.
    About 8Kb per sec, or close to the same for the original file. This would
    seem to indicate there is value in reducing white space.

    Comment

    • Stephen Poley

      #3
      Re: Don't bother saving white-space

      On Thu, 19 Aug 2004 15:00:09 -0400, Neal <neal413@yahoo. com> wrote:
      [color=blue]
      >On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
      ><sbpoleySpiced HamTrap@xs4all. nl> wrote:
      >[color=green]
      >> The first page loads in 3 seconds, the second in 8 seconds - both
      >> figures seem to be repeatable.[/color][/color]
      [color=blue]
      >For me, original=3secs, bloated=21 secs.
      >
      >The extra white space amounts to 142 Kb. Took me 18 extra seconds to load.
      >About 8Kb per sec, or close to the same for the original file. This would
      >seem to indicate there is value in reducing white space.[/color]

      That's interesting. I wonder what causes the difference? What browser
      are you using? Are you using a 56Kb modem? - if so, it indicates that it
      must be doing some compression, or the 'bloated' transmission would take
      around 30 seconds.

      --
      Stephen Poley


      Comment

      • Els

        #4
        Re: Don't bother saving white-space

        Stephen Poley wrote:
        [color=blue]
        > On Thu, 19 Aug 2004 15:00:09 -0400, Neal
        > <neal413@yahoo. com> wrote:
        >[color=green]
        >>On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
        >><sbpoleySpice dHamTrap@xs4all .nl> wrote:
        >>[color=darkred]
        >>> The first page loads in 3 seconds, the second in 8
        >>> seconds - both figures seem to be repeatable.[/color][/color]
        >[color=green]
        >>For me, original=3secs, bloated=21 secs.
        >>
        >>The extra white space amounts to 142 Kb. Took me 18 extra
        >>seconds to load. About 8Kb per sec, or close to the same
        >>for the original file. This would seem to indicate there is
        >>value in reducing white space.[/color]
        >
        > That's interesting. I wonder what causes the difference?
        > What browser are you using? Are you using a 56Kb modem? -
        > if so, it indicates that it must be doing some compression,
        > or the 'bloated' transmission would take around 30 seconds.[/color]

        I'm on broadband, the first is done within a second, the second
        one takes 2/3 secs.

        I suppose that could add up if you're working with 'flip-
        through' pages, even for broadband.

        --
        Els http://locusmeus.com/
        Sonhos vem. Sonhos vão. O resto é imperfeito.
        - Renato Russo -
        Now playing: Magnum - No Way Out

        Comment

        • Neal

          #5
          Re: Don't bother saving white-space

          On Thu, 19 Aug 2004 21:39:41 +0200, Stephen Poley
          <sbpoleySpicedH amTrap@xs4all.n l> wrote:
          [color=blue]
          > On Thu, 19 Aug 2004 15:00:09 -0400, Neal <neal413@yahoo. com> wrote:
          >[color=green]
          >> On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
          >> <sbpoleySpicedH amTrap@xs4all.n l> wrote:
          >>[color=darkred]
          >>> The first page loads in 3 seconds, the second in 8 seconds - both
          >>> figures seem to be repeatable.[/color][/color]
          >[color=green]
          >> For me, original=3secs, bloated=21 secs.
          >>
          >> The extra white space amounts to 142 Kb. Took me 18 extra seconds to
          >> load.
          >> About 8Kb per sec, or close to the same for the original file. This
          >> would
          >> seem to indicate there is value in reducing white space.[/color]
          >
          > That's interesting. I wonder what causes the difference? What browser
          > are you using? Are you using a 56Kb modem? - if so, it indicates that it
          > must be doing some compression, or the 'bloated' transmission would take
          > around 30 seconds.
          >[/color]

          Opera 7.23 on dialup 56k, 45333 bps.

          Comment

          • Alan J. Flavell

            #6
            Re: Don't bother saving white-space

            On Thu, 19 Aug 2004, Stephen Poley wrote:
            [color=blue]
            > I took one of my pages:
            > http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
            > which is 20 Kb.
            >
            > I then bloated it with whitespace to 162 Kb (nothing special about that
            > number - it's just what it happened to end up as):
            > http://www.xs4all.nl/~sbpoley/misc/checklist.html[/color]

            It may be of interest that when gzipped, your file sizes came out as
            7711 and 8805 respectively. So as we've been saying all along (well,
            since NCSA X Mosaic had been supporting gzipped HTML about a decade
            back, courtesy of jwz), there's far more to be gained by serving out
            HTML gzipped than by fussing about a bit of white space.

            thanks for the heads-up, though - no offence meant! ;-)

            Comment

            • Andrew Graham

              #7
              Re: Don't bother saving white-space

              Stephen Poley wrote:[color=blue]
              > last few days, I decided it was time for a test on the effect of
              > white-space.
              >
              > I took one of my pages:
              > http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
              > which is 20 Kb.
              >
              > I then bloated it with whitespace to 162 Kb (nothing special about
              > that number - it's just what it happened to end up as):
              > http://www.xs4all.nl/~sbpoley/misc/checklist.html
              >
              > I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
              > ask - I don't know either) using Opera 7.
              >
              > The first page loads in 3 seconds, the second in 8 seconds - both
              > figures seem to be repeatable. This suggests that if you took a file[/color]

              Here are two more data points for you, both over 24kbps modem from USA
              west coast:

              1) Firefox:
              9 seconds vs. 13 seconds

              2) wget:
              D:\test>timethi s wget -q
              http://www.xs4all.nl/~sbpoley/webmatters/checklist.html | grep "Elapsed"
              TimeThis : Elapsed Time : 00:00:05.107

              D:\test>timethi s wget -q
              http://www.xs4all.nl/~sbpoley/misc/checklist.html | grep "Elapsed"
              TimeThis : Elapsed Time : 00:00:15.322

              Living in an area without high-speed connections, I appreciate more than
              most the value of fast websites, but I still indent and wrap my html.
              Using your page as an example, it is 19135 bytes without any newlines or
              duplicate spaces, and 20803 bytes indented and wrapped at column 72.
              Tiny difference.
              [color=blue]
              > Somehow it just doesn't seem worth it ...[/color]

              Yup. Optimize those jpegs instead.



              Comment

              • Arne

                #8
                Re: Don't bother saving white-space

                Stephen Poley wrote:[color=blue]
                > People in these groups, and on web-pages, not infrequently suggest that
                > it is worthwhile cutting down on white-space and comments in HTML and
                > CSS in order to reduce loading times. I and others have more than once
                > doubted this, given the data-compression in the HTTP protocol. Having
                > seen it suggested again a couple of times in the last few days, I
                > decided it was time for a test on the effect of white-space.
                >
                > I took one of my pages:
                > http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
                > which is 20 Kb.
                >
                > I then bloated it with whitespace to 162 Kb (nothing special about that
                > number - it's just what it happened to end up as):
                > http://www.xs4all.nl/~sbpoley/misc/checklist.html
                >
                > I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
                > ask - I don't know either) using Opera 7.
                >
                > The first page loads in 3 seconds, the second in 8 seconds - both
                > figures seem to be repeatable. This suggests that if you took a file
                > with a fairly generous 5Kb of white-space, and stripped out all of it,
                > loading would be speeded up by a princely one-sixth of a second. (For
                > comparison, the largest HTML file on my site, of 79Kb, turned out to
                > have just under 3Kb of compressible white-space.)
                >
                > Somehow it just doesn't seem worth it ...
                >[/color]

                My opinion is that the total size (i.e. images included) is to be
                considered.

                According to http://www.websiteoptimization.com/ a analysis on your page
                /webmatters/checklist.html gives this result

                Total Size: 43638 bytes
                HTML: 19685
                Images: 18539
                CSS: 5414
                Total Images: 4
                Download Times*
                56K 8.90 seconds


                Same analysis on the page misc/checklist.html

                Total Size: 189818 bytes
                HTML: 165865
                Images: 18539
                CSS: 5414
                Total Images: 4
                Download Times*
                56K 38.03 seconds

                So, if (at it looks) you don't change anything else than adding
                whitespace to the code, the download time change with aprox 29 sec for a
                56K dial up connection!

                --
                Arne

                Comment

                • Nick Kew

                  #9
                  Re: Don't bother saving white-space

                  In article <opscztqjsm6v66 56@news.individ ual.net>,
                  Neal <neal413@yahoo. com> writes:
                  [color=blue][color=green]
                  >> People in these groups, and on web-pages, not infrequently suggest that
                  >> it is worthwhile cutting down on white-space and comments in HTML and
                  >> CSS in order to reduce loading times. I and others have more than once
                  >> doubted this, given the data-compression in the HTTP protocol. Having[/color][/color]

                  Compression is optional in HTTP, and only works if you've enabled it
                  on the server (eg with mod_deflate).
                  [color=blue][color=green]
                  >> http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
                  >> which is 20 Kb.[/color][/color]

                  HTTP compression is not enabled on that URL.
                  [color=blue][color=green]
                  >> I then bloated it with whitespace to 162 Kb (nothing special about that
                  >> number - it's just what it happened to end up as):
                  >> http://www.xs4all.nl/~sbpoley/misc/checklist.html[/color][/color]

                  Nor there.
                  [color=blue][color=green]
                  >> I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
                  >> ask - I don't know either) using Opera 7.[/color][/color]

                  I expect you have PPP compression enabled in your modem.
                  [color=blue][color=green]
                  >> The first page loads in 3 seconds, the second in 8 seconds - both
                  >> figures seem to be repeatable.[/color][/color]

                  That's a significant difference. If you had HTTP compression enabled there
                  should be negligible difference (because that extra 162K would be wiped out).
                  [color=blue]
                  > For me, original=3secs, bloated=21 secs.[/color]

                  Either you have no PPP compression (very bad), or you have a bottleneck
                  elsewhere in your connection.
                  [color=blue]
                  > About 8Kb per sec, or close to the same for the original file. This would
                  > seem to indicate there is value in reducing white space.[/color]

                  Indeed, in some circumstances there is. But there is much more value
                  in mod_deflate. And if you use that, the value in reducing whitespace
                  vanishes. That applies to any repetitive patterns - such as HTML tags -
                  but not to comments (mentioned in passing in the OP).

                  --
                  Nick Kew

                  Nick's manifesto: http://www.htmlhelp.com/~nick/

                  Comment

                  • Andrew Thompson

                    #10
                    Re: Don't bother saving white-space

                    On Thu, 19 Aug 2004, Stephen Poley wrote:[color=blue]
                    >On Thu, 19 Aug 2004 20:41:12 +0100, Alan J. Flavell wrote:[/color]
                    [color=blue][color=green]
                    >> http://www.xs4all.nl/~sbpoley/misc/checklist.html[/color]
                    >
                    > It may be of interest that when gzipped, your file sizes came out as
                    > 7711 and 8805 respectively.[/color]

                    I have just been playing with various arcane
                    aspects of Zip compression over on c.l.j.p., so
                    I was particularly interested to see if you had ..

                    a) 'blobbed' the white-space in a large chunk, as opposed to
                    b) giving an extra space or two between each word,

                    ...for example.

                    The reason is that most compression algorithms
                    will compress the 'large space' better than many
                    small spaces.

                    And.. yes, I noticed you made that mistake,
                    large chunks of whitespace that are easily
                    compressible, with a fairly clear pattern.

                    I would be convinced only if you started from
                    the outset with a more realistic (chaotic)
                    example.

                    --
                    Andrew Thompson
                    http://www.PhySci.org/ Open-source software suite
                    http://www.PhySci.org/codes/ Web & IT Help
                    http://www.1point1C.org/ Science & Technology

                    Comment

                    • Frostillicus

                      #11
                      Re: Don't bother saving white-space

                      I've switched to indenting my HTML out with tabs instead of spaces. It took
                      some getting used to as I didn't like how far they appeared to be indented
                      (I'm still a notepad junkie) but I got used to it and file sizes are much
                      smaller now (and my thumbs aren't as sore any more as I don't have to keep
                      hitting the space bar that much).


                      Comment

                      • Jukka K. Korpela

                        #12
                        Re: Don't bother saving white-space

                        "Frostillic us" <frosty@nilspam os.iinet.net.au > wrote:
                        [color=blue]
                        > I've switched to indenting my HTML out with tabs instead of spaces.[/color]

                        You are trolling, are you not? As usual, crossposting to two groups
                        without setting followups is a probable sign of spamming, trolling, or
                        cluelessness, and a forged From field supports this impression.
                        So does lack of any reference to preceding discussion (such as quotation
                        or summary of the message being commented on).

                        In HTML, a tab is equivalent to a space, except in special occasions. But
                        almost any use of tabs in HTML is a symptom of some misunderstandin g.

                        Followups trimmed. Indentation of HTML source is surely not a CSS
                        business.

                        --
                        Yucca, http://www.cs.tut.fi/~jkorpela/

                        Comment

                        • Frostillicus

                          #13
                          Re: Don't bother saving white-space

                          I'm not trolling and I do definitely use tabs to space out HTML as well as
                          CSS selectors (sorry, I should have made mention of styles since this is a
                          stylesheet newsgroup).

                          And as for cross-posting, I think you'll find the original post from Stephen
                          Poley was posted to more than one group, and OE must have included them all
                          when I clicked "reply group". I'm not losing any sleep over it...

                          As for the "nilspamos" in my email address, my ISP does it for me, and I've
                          got no problem with that. I take it you don't mind your email address being
                          harvested and used for the sole purpose of flooding your inbox? Enjoy your
                          spam!


                          Comment

                          • Jukka K. Korpela

                            #14
                            Re: Don't bother saving white-space

                            "Frostillic us" <frosty@nilspam os.iinet.net.au > wrote:
                            [color=blue]
                            > I'm not trolling[/color]

                            You just confirmed it by many things, including the sending of your
                            message to the wrong group, contrary to Followup-To settings.

                            Please do not stop using your current forged address until you wish to
                            participate in constructive discussions.

                            --
                            Yucca, http://www.cs.tut.fi/~jkorpela/

                            Comment

                            • Stephen Poley

                              #15
                              Re: Don't bother saving white-space

                              On Thu, 19 Aug 2004 23:26:02 +0000 (UTC), "Jukka K. Korpela"
                              <jkorpela@cs.tu t.fi> wrote:
                              [color=blue]
                              >"Frostillicu s" <frosty@nilspam os.iinet.net.au > wrote:
                              >[color=green]
                              >> I've switched to indenting my HTML out with tabs instead of spaces.[/color]
                              >
                              >You are trolling, are you not? As usual, crossposting to two groups
                              >without setting followups is a probable sign of spamming, trolling, or
                              >cluelessness , and a forged From field supports this impression.
                              >So does lack of any reference to preceding discussion (such as quotation
                              >or summary of the message being commented on).
                              >
                              >In HTML, a tab is equivalent to a space, except in special occasions. But
                              >almost any use of tabs in HTML is a symptom of some misunderstandin g.
                              >
                              >Followups trimmed. Indentation of HTML source is surely not a CSS
                              >business.[/color]

                              Having a bad night, Jukka? The subject matter of the thread not only can
                              be, but has been, raised in respect of both HTML and CSS and it appears
                              to be relevant to both groups.

                              Further, given that tab is explicitly defined as a whitespace character
                              in HTML, your comment on that deserves a little further explanation.

                              (I'll grant you the comment on the lack of any quoted material.)

                              --
                              Stephen Poley


                              Comment

                              Working...