javaxmldomxpathxom

performance of xom xpath queries vs. jaxp xpath query vs. dom performance


What's difference between xom xpath impl. and jaxp xpath impl.?

Most posts on this site say to use nu.xom over org.w3c.dom in java, and that dom parsing is faster than xpath. Why would you use nu.xom over jaxp xpath if the only use of the libraries would be for xpath queries?


Solution

  • If you are building a tree solely for the purpose of running XPath queries, then a tree structure that is optimized for this purpose can give substantial benefits, as shown here:

    http://dev.saxonica.com/blog/mike/2012/09/

    The primary reason that the TinyTree performs so much faster than the alternatives is that it is designed for XPath processing alone. It is immutable, which makes sorting of nodes into document order much easier, and it uses integer name codes for matching names against a search query.