libxml2的外籍VS一个XMPP服务器 [英] libxml2 vs expat for an XMPP server

查看:444
本文介绍了libxml2的外籍VS一个XMPP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在(虽然语言本身是无关)作为学习什么我可以对一般的XMPP协议和服务器软件发展的手段。

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.

正如你们许多人知道,XMPP是一种基于XML消息传递协议,取决于短,但频繁的XML流的大量。我在想,这样的应用程序的基于事件的XML解析器应该会更好,因为我不需要DOM和所有(纠正我,如果我错了)。请记住,这个库是用于服务器,因此可能有很多实例同时运行;

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;

这两个中的一个具有该用例的libxml2或外籍人士更好的性能和内存使用情况?

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

推荐答案

有一个整个项目致力于回答的XML表现堪称的 XML基准

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

简短的回答,在我看来,就是用的libxml2,但我有其他的考虑超越纯粹的性能,比如平台的可用性。这就是说,它通常更快根据最新数字比外籍人士,虽然它是在事物的伟大计划相当接近。

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.

是的,你要使用SAX解析器,而不是DOM解析器。

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

这篇关于libxml2的外籍VS一个XMPP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆