libxml2 vs expat for an XMPP server
Asked Answered
L

1

6

I'm trying to create an XMPP library (and later a server) from scratch in Go (although the language itself is irrelevant) as a means to learn what I can about the XMPP protocol and server software development in general.

As many of you know, XMPP is messaging protocol based on XML that depends on an enormous amount of short but frequent XML streams. I'm thinking that for such applications an event based XML parser should be better because I won't need DOM and all that (correct me if I'm wrong). Please keep in mind that this library is intended for servers so there might be many instances run at once;

Which one of the two has better performance and memory usage for that use case, libxml2 or expat?

Lecythus answered 15/9, 2010 at 2:5 Comment(0)
O
11

There is a whole project devoted to answering the question of XML performance called XML Benchmark.

The short answer, in my opinion, is to use libxml2, but I have other considerations beyond pure performance, such as platform availability. That said, it is generally faster than expat according to the latest numbers, though it's fairly close in the great scheme of things.

And yes, you want to use the SAX parser, not the DOM parser.

Ohg answered 15/9, 2010 at 4:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.