3

I am processing an average of 18 MB XML where the XPaths are intensive with predicates. I tried to profile the processing (warmed up the JVM) and the average processing time is 20 seconds. I would like to know if there are techniques to make it faster? Like avoid using predicates?

vtd-xml-author
  • 3,319
  • 4
  • 22
  • 30
sincang
  • 119
  • 5

1 Answers1

0

If you are running XPaths over a lot of small xml files, then it is important to reuse XPath expressions instead of repetitively compiling them for every use. The key is to take the "ap.selectXPath()" out of any loop, and call ap.resetXPath() in order for the ensuing reuse....

vtd-xml-author
  • 3,319
  • 4
  • 22
  • 30