Re: [XCON] On encodings - observations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XCON] On encodings - observations
This is interesting analysis, so I thought I'd try to add a bit more detail
to it.
I've got some minor observations on the original post here, and some more
detailed analysis in a separate post.
----- Original Message From: "Henning Schulzrinne" <hgs at cs.columbia.edu>>
For XML, you have
<tag </tag>, thus, 4 bytes plus whatever length you make the tag
Should be <tag></tag> e.g. 5 bytes.
Thus, the basic overhead is fairly similar if you choose small element
names. Since numeric labels aren't self-describing at all, this only
seems like a fair comparison.
My observation on this is that XSD does not lend itself to designing XML
with small tags. If everything is called X (or similar) the XSD doesn't
describe the message very well. So, although you can define an XSD with
small tags, I think in practice you wouldn't! (Aside: This is why Lumas
allows for specifying a long descriptive name in the message definition, and
specifying a short name for tagging.)
Integers and floats are trickier: Unless you believe in ASN.1-style
variable-length encoding, it is quite possible that in many practical
cases, XML integers will be shorter since TLV always has to allocate the
maximum range,
This depends significantly on the distribution of the numbers within the
range. If you have a 16 bit number, only the numbers 0-9 will be shorter
than the binary encoding (not that I'm pushing binary, as you will see.
Just trying to get the facts straight.) This is 0.01% of the time _if_ the
numbers are evenly distributed. If they are evenly distributed (which is a
big assumption) text will be longer in 98% of the cases. For 32 bit values,
text will be longer in 99.999% of the cases. (again, distribution is a big
issue here.)
You do pay a price for very long tags, but only if you can't use gzip-
style compression, which essentially does the text-to-code translation
automatically and without penalty.
gzip isn't free. It costs on small devices and servers handling a lots of
connections. Hence I don't think you can say it is without penalty.
Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx
(or http://www.xml2cpp.com)
=============================================
_______________________________________________
XCON mailing list
XCON at ietf.org
https://www1.ietf.org/mailman/listinfo/xcon
Note: Messages sent to this list are the opinions of the senders and do not imply endorsement by the IETF.