Are there faster XML parsers in Java than Xalan/Xe

2019-03-18 10:07发布

I haven't found many ways to increase the performance of a Java application that does intensive XML processing other than to leverage hardware such as Tarari or Datapower. Does anyone know of any open source ways to accelerate XML parsing?

6条回答
Root(大扎)
2楼-- · 2019-03-18 10:38

VTD-XML is very fast.

It has a DOM-like API and even XPath queries.

查看更多
对你真心纯属浪费
3楼-- · 2019-03-18 10:38

Since it hasn't been directly mentioned, I'll throw in Aalto, which is fastest java xml parser according to some measurements, like:

which are not written by Aalto developers.

查看更多
够拽才男人
4楼-- · 2019-03-18 10:41

Take a look at Stax (streaming) parsers. See the sun reference manual. One of the implementations is the woodstox project.

查看更多
家丑人穷心不美
5楼-- · 2019-03-18 10:48

Check Javolution as well

查看更多
【Aperson】
6楼-- · 2019-03-18 10:54

Depending on the complexity of your XML messages you might find a custom parser can be 10x faster (though more work to write) However if performance is critical, I wouldn't suggest using a generic parser. (Also I wouldn't suggest using XML as its not designed for performance, but that's another story, .. ;)

查看更多
不美不萌又怎样
7楼-- · 2019-03-18 10:55

Piccolo claims to be pretty fast. Can't say I've used it myself though. You might also try JDOM. As ever, benchmark with representative data of your real load.

It partly depends on what you're trying to do. Do you need to pull the whole document into memory, or can you operate in a streaming manner? Different approaches have different trade-offs and are better for different situations.

查看更多
登录 后发表回答