Lists Home |
Date Index |
Alaric Snell-Pym wrote:
> Rick Marshall wrote:
>> xml messages compress well because the tags as a group in a message
>> contain very little information. the message content however contains
>> a lot of information and doesn't compress as well, hence it doesn't
>> matter if it's binary or ascii - the information content is high and
>> therefore the bits to represent it will be high. most arguments about
>> binary/ascii representation of numbers look at specifics and ignore
>> the principle.
> Bear in mind that although XML compresses well, it doesn't end up
> smaller than the result of compressing a compact binary
> representation, in general.
> As you say, you still have to communicate the underlying information,
> but with XML you also have to communicate the fact that the tags were
> there, that the number was in fact a number and not text, and so on.
> Eg, the number 53 can be encoded in binary as a single byte. In ASCII,
> it's two bytes, each of which could take any value. The compressor
> will need to communicate the fact that it was the number 53, when it
> could have been the string "UK".
actually modern compressors don't know about the representation and
don't much mind. they actually work on the entropy of the message and
the message as a bit stream - ie they don't know there are tags, ascii
data, binary, data, schema etc. there's not room to go into it here but
they will compress a message fairly consistently based on the entropy of
the message, not the representation. different algorithms are marginally
better than others (bzip2 vs gzip eg), but seem to give proportionally
further info from http://datacompression.info/Compression.shtml
tel;cell:+61 411 287 530