[Standards] mobile optimizations: binary xml

Fabio Forno fabio.forno at gmail.com
Mon Apr 7 15:15:49 UTC 2008

(no jokes this time ;)

Since one of the most requested features for mobiles is compression
and binary xml is often proposed for this, I've tried to summarize few
of the points in my blog (http://blog.bluendo.com/ff/real-binary-xmpp)

The point (upon which we had rather consensus in the past) is that
using binary xml for compressing is tough and perhaps you end with
surprises (e.g. too much cpu time or, in general, lack of
extensibility). The point of Android people, instead, was that xml +
zlib is too heavy.
So I did an experiment: a very fast xml serialization (inspired to
ASN.1, just using binary token types and lengths before the tokens)
with no compression at all, just a parser friendly encoding, and then
I've applied zlib at the top of it. The results are very promising;
here are the figures with the j2me parser I've written for testing:

| method     | size (kB)  | time (ms) |
| xml           | 7458         | 2200 |
| xml + zlib | 535           | 3000 |
| bin            | 6337         | 600   |
| bin + zlib  | 541           |1200  |

As you can see bin + zlib is comparable in size to xml + lib, but it
is much faster (so less battery hungry) than xml alone!


Fabio Forno, Ph.D.
Bluendo srl http://www.bluendo.com
jabber id: ff at jabber.bluendo.com

More information about the Standards mailing list