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?

4

1 回答 1

0

如果您在很多小的 xml 文件上运行 XPath,那么重用 XPath 表达式而不是为每次使用都重复编译它们很重要。关键是将“ap.selectXPath()”从任何循环中取出,并调用 ap.resetXPath() 以便随后重用....

于 2015-02-28T19:49:09.543 回答