[jdev] A rapidxml fork for XMPP

Dave Cridland dave at cridland.net
Thu Dec 5 08:54:37 UTC 2013


On Thu, Dec 5, 2013 at 6:15 AM, mat henshall <mat at squareconnect.com> wrote:

> I do agree on the need for using optimized parsers (we have an xml parser
> that fits in a few hundred bytes of code and read only memory) that is
> extremely fast and efficient on small devices. BTW the trick to avoid the
> tag comparison is to convert the various tags and namespaces to hash values
> as they come in during parsing and then only compare on the hash value. We
> have a small utility that calculates the hash values and writes as a header
> file as part of the compile time all the possible namespaces and tag names
> that we are interested in. Extremely efficient in terms of both computation
> and memory space. Careful choice of the hash algorithm means very little
> chance of collision.
>
>
That's a neat idea - I was intending to add in attribute hashing in order
to handle the well-formedness constraints (and also optimize attribute
searches in general), but I'd not thought about compile-time precalculation
of hashes, that's terribly clever, and an idea I'll shamelessly steal.
FWIW, I was also going to build a simplistic single-hash Bloom on parse to
elide some searches, too.

Are you using any particular hash algorithm, or are you generating a
perfect hash at buildtime too?

Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20131205/3ee8881c/attachment.html>


More information about the JDev mailing list