<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=146373909-26091999>I
would expect that gzip sees the attribute as </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> ="</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> name</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> "</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=146373909-26091999>while
it sees elements as</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> <</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> name</SPAN></FONT><FONT
color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999>></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> </</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> name</SPAN></FONT><FONT
color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999>></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999>Meaning three substrings for attributes, while 4
substrings for elements, where only 1 of them occurs twice.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=146373909-26091999>Seems
that the corrected benchmark proves that my surprise was not without reason :-)
(posting attached again).</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Tyler Baker
[mailto:tyler@infinet.com]<BR><B>Sent:</B> Sunday, September 26, 1999 10:04
AM<BR><B>To:</B> Julian Reschke<BR><B>Cc:</B> Mark Nutter;
xml-dev@ic.ac.uk<BR><B>Subject:</B> Re: RFC: Attributes and
XML-RPC<BR><BR></DIV></FONT>Julian Reschke wrote:
<BLOCKQUOTE TYPE="CITE"> <SPAN class=240074008-23091999><FONT
face=Arial><FONT color=#0000ff><FONT size=-1>I find this way surprising.
Yes, it's clear that opening and closing tags compress well, but I would
still have expected the attribute version to be
smaller...</FONT></FONT></FONT></SPAN> </BLOCKQUOTE>
<P><BR>Each quote (2 of them), comma, equal, and attribute name take up 5-10
bytes for each attribute when mapped to a symbol table, while the element
style takes up 2-4 bytes for the start tag and the end tag. The exact number
of bytes used for each attribute or element is dependent on the compression
algorithm and the number of different attribute or element names used. So it
is no surprise to me that using GZIP produces a compressed attribute file that
is larger (-:
<P>Tyler <FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999> </SPAN></FONT>
<P><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999></SPAN></FONT>
<P><FONT color=#0000ff face=Arial size=2><SPAN
class=146373909-26091999>-- </SPAN></FONT></P><FONT color=#0000ff
face=Arial size=2><SPAN class=146373909-26091999><FONT size=2>
<P>> -----Original Message-----</P>
<P>> From: Mark Nutter [SMTP:mnutter@fore.com]</P>
<P>> Sent: Thursday, September 23, 1999 6:34 AM</P>
<P>> To: Blair Murri; xml-dev@ic.ac.uk</P>
<P>> Subject: RE: RFC: Attributes and XML-RPC</P>
<P>> </P>
<P>> Doh! "Code in haste, debug in leisure." Ok, here are the corrected</P>
<P>> results:</P>
<P>> </P>
<P>> $ ./make.pl</P>
<P>> $ ls -l</P>
<P>> total 14206</P>
<P>> -rw-rw-r-- 1 mnutter mnutter 5811846 Sep 23 08:28 attrib.xml</P>
<P>> -rw-rw-r-- 1 mnutter mnutter 8672170 Sep 23 08:28 child.xml</P>
<P>> -rwxr-xr-x 1 mnutter mnutter 999 Sep 23 08:26 make.pl</P>
<P>> -rwxr-xr-x 1 mnutter mnutter 976 Sep 22 13:16 make.pl~</P>
<P>> $ gzip attrib.xml</P>
<P>> $ gzip child.xml</P>
<P>> $ ls -l</P>
<P>> total 1332</P>
<P>> -rw-rw-r-- 1 mnutter mnutter 670757 Sep 23 08:28 attrib.xml.gz</P>
<P>> -rw-rw-r-- 1 mnutter mnutter 681080 Sep 23 08:28 child.xml.gz</P>
<P>> -rwxr-xr-x 1 mnutter mnutter 999 Sep 23 08:26 make.pl</P>
<P>> -rwxr-xr-x 1 mnutter mnutter 976 Sep 22 13:16 make.pl~</P>
<P>> </P>
<P>> So child.xml.gz is slightly larger than attrib.xml.gz (about 1.5%,</P>
<P>> assuming my math isn't as bad as my coding).</P>
<P>> </P>
<P>> That is what I would have expected. But, performance may be more
than</P>
<P>> network transport. I've got an app, where, for convenience, I have</P>
<P>> wrapped MS's IE 5 MSXML parser, and I found a significant difference
in</P>
<P>> speed by placing stuff that there was only one of as an attribute
instead</P>
<P>> of a child element. I don't know why yet, but the attributes where
faster</P>
<P>> (I don't know if that was "recording" speed or "retrieval" speed) than
the</P>
<P>> child elements using just that one parser. Of course, your mileage
may</P>
<P>> vary.</P>
<P>> </P>
<P>Blair L. Murri</P>
<P>Sr. Programmer/etc.</P>
<P>Wavo Corporation</P></FONT></SPAN></FONT></BLOCKQUOTE></BODY></HTML>