Fast XPath parsing for simple expressions
In XSLT, many path expressions are extremely simple. I collected some data and found that about 50% of path expressions in XSLT stylesheets belong to simple patterns such as
function() that can be readily detected after tokenization without going into the full recursive-descent parser, which has a lot of overhead for such simple expressions.
I've implemented a plug-in to the XPath parser for Saxon-EE that does this pre-scanning. The gains are not huge (about 4%), but they are worthwhile. The feature may make a bigger difference for applications that execute XPath expressions directly from Java, and fail to use caching to reduce XPath parsing costs.
Please register to edit this issue