简体   繁体   English

Java - XML解析器性能:Sun Java Streaming XML Parser(SJSXP)与Woodstox

[英]Java - XML parser performance : Sun Java Streaming XML Parser (SJSXP) vs Woodstox

I am looking for latest, memory efficient and high-performance java XML parsing API. 我正在寻找最新的,内存效率和高性能的Java XML解析API。 I need to parse 3 MB to 5 MB XML files. 我需要解析3 MB到5 MB的XML文件。

I did google on this and come to know about Sun Java Streaming XML Parser (SJSXP) and Woodstox is much faster than DOM & SAX. 我对此进行了谷歌搜索并了解了Sun Java Streaming XML Parser(SJSXP),Woodstox比DOM和SAX快得多。 Both are using StAX API. 两者都使用StAX API。 *schema validation is not supported by these technologies. *这些技术不支持架构验证。

Aalto XML processor is also implements StAX API. Aalto XML处理器也实现了StAX API。

I have not found concrete findings on performance on these technologies. 我没有找到关于这些技术的性能的具体发现。

Which one will be best in context of memory efficient, high-performance and ease of use ? 哪一个在内存高效,高性能和易用性方面最佳?

Here are some more links that might be relevant: 以下是一些可能相关的链接:

As to performance: SJSXP is the slowest; 至于表现:SJSXP是最慢的; it's just a repackage internals of Xerces, wrapped in Stax API. 它只是一个重新打包的Xerces内部,包含在Stax API中。 This has some negative effects on performance (since it's not really designed for pull parsing). 这对性能有一些负面影响(因为它不是真正设计用于拉解析)。 Woodstox is bit faster; Woodstox有点快; much faster for small documents and writing, less difference when parsing longer documents. 对于小文档和写入来说,快得多,在解析较长文档时差异较小。

And Aalto is by far fastest of the three, especially for parsing. 阿尔托是三者中最快的,尤其是解析。 It is commonly 50% - 100% faster than either Woodstox or SJSXP. 它通常比Woodstox或SJSXP快50%-100%。 One downside is that it does not handle DTDs (and thereby not external entities; it handles pre-defined and character entities). 一个缺点是它不处理DTD(因此不处理外部实体;它处理预定义和字符实体)。

Disclaimer: I am author of Woodstox and Aalto; 免责声明:我是Woodstox和Aalto的作者; as well as contributor to SJSXP (bug fixes) 以及SJSXP的贡献者(错误修复)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM