473,588 Members | 2,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:
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 ...

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #1
45 3464
On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
<sb************ ******@xs4all.n l> wrote:
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.


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.
Jul 20 '05 #2
On Thu, 19 Aug 2004 15:00:09 -0400, Neal <ne*****@yahoo. com> wrote:
On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
<sb*********** *******@xs4all. nl> wrote:
The first page loads in 3 seconds, the second in 8 seconds - both
figures seem to be repeatable.
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.


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

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #3
Els
Stephen Poley wrote:
On Thu, 19 Aug 2004 15:00:09 -0400, Neal
<ne*****@yahoo. com> wrote:
On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
<sb********** ********@xs4all .nl> wrote:
The first page loads in 3 seconds, the second in 8
seconds - both figures seem to be repeatable.

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.


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.


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
Jul 20 '05 #4
Stephen Poley <sb************ ******@xs4all.n l> wrote:
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
I'd suggest that whitespace and comments are 2 different things.
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
What you've done there is not typical coding whitespace, usually this
refers to blank lines (cr/lf pair on a line of it's own) and tabs, not
padding a document with spaces.
I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
ask - I don't know either)
56K is the theoretical maximum, in reality this is never achieved, sub
50K is pretty normal.
The first page loads in 3 seconds, the second in 8 seconds - both
figures seem to be repeatable.


I don't know anything about http protocol data compression, but note
that modem connections typically include the V42b protocol. V42b
provides real time compression up to 4x. Ascii data typically compresses
very well.

--
Spartanicus
Jul 20 '05 #5
On Thu, 19 Aug 2004 21:39:41 +0200, Stephen Poley
<sb************ ******@xs4all.n l> wrote:
On Thu, 19 Aug 2004 15:00:09 -0400, Neal <ne*****@yahoo. com> wrote:
On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
<sb************ ******@xs4all.n l> wrote:
The first page loads in 3 seconds, the second in 8 seconds - both
figures seem to be repeatable.

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.


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.


Opera 7.23 on dialup 56k, 45333 bps.
Jul 20 '05 #6
On Thu, 19 Aug 2004, Stephen Poley wrote:
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


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! ;-)
Jul 20 '05 #7
Stephen Poley wrote:
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
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.
Somehow it just doesn't seem worth it ...


Yup. Optimize those jpegs instead.

Jul 20 '05 #8
Stephen Poley wrote:
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 ...


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
Jul 20 '05 #9
Spartanicus <me@privacy.net > wrote:
http://www.xs4all.nl/~sbpoley/misc/checklist.html


What you've done there is not typical coding whitespace, usually this
refers to blank lines (cr/lf pair on a line of it's own) and tabs, not
padding a document with spaces.


A more realistic example of documents with and without coding
whitespace:
http://www.pan-europe.utvinternet.ie...hite_space.htm
(50,066 bytes)
http://www.pan-europe.utvinternet.ie...hite_space.htm
(48,658 bytes)

In addition to the tab's and cr/lf's that I normally use I've added a
blank line between every line of code in the first document.

--
Spartanicus
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
17539
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
138
6482
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday, April 6th, 2004 @ 01:49PM from the yeah,-that's-non-obvious dept. theodp writes "As if there weren't enough dodgy patents, here's an excerpt from one granted to Microsoft Tuesday for a 'Method and apparatus for displaying information regarding stored data in a gaming system': 'When saving a game,...
28
3213
by: Xiaotian Sun | last post by:
I added the following line to the header of my html file <meta http-equiv="content-type" content="text/html; charset=utf-8"> hoping browsers will use UTF-8 encoding. But all browsers I tried still use ISO-8859-1. What did I do wrong? Thanks,
14
2055
by: Xah Lee | last post by:
is there a way to condense the following loop into one line? # -*- coding: utf-8 -*- # python import re, os.path imgPaths= # change the image path to the full sized image, if it exists
4
338
by: #kiss# | last post by:
hey guy !! i m a beginer on C prog...i m using DEV-C IDE but when i m running a .EXE the dos window open , run the .EXE and closed quickly, how could i do if i don't want the dos window closed....what kind of code could i write at the end ??
0
1788
by: Karen Grube | last post by:
Hi! I hate to bother you all with this, but I don't know how best to approach a particular task. Here's the deal: Once a month I personally (that is, in my own personal inbox on my company's email server) receive an email from one of our vendors to which is attached a text file (a comma-delimited data file containing the details of our monthly
3
11428
by: Chantal | last post by:
Hello everybody, I'm relatively new to javascript + DOM so I've a question : I'm removing <div> elements in DOM with javascript. It works perfectly in Firefox and Opera : I mean the DOM is refreshed automatically and I see the changes. But in IE (version 6), I don't see any changes. Do I have do to something more with IE to tell "him" to refresh the DOM.
5
4723
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the date stamped on the lower right part of the picture. (I'm not an advanced programmer so my code may not be 100% efficient - sorry, I'm still learning) Everything works fine until the saving part. I've been able to read the file into a...
2
2106
by: Pradeep Varma | last post by:
Hi, I am using Acrobat 6.0. I am trying to save an Access report to a PDF file using the Acrobat Distiller but came across an error message “ActiveX component cannot create object –429”. I have tried all sorts of things based on information that I got but not able to get rid of the same. The code that I use is:
2
1837
by: Eric | last post by:
When i bound the other form in my main form. The whole first subform area is covered with white color. But when i bound another form its not shows the whole area in white color. Why my one subform shows the whole area in white color. I mean its nothing shows any thing in that area. But my other form shows all of the fields and labels in that area where i created it. Thanks.
0
7929
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7862
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5729
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3847
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2372
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1459
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.