Project

Profile

Help

Feature #4078

Fast XPath parsing for simple expressions

Added by Michael Kay almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Sprint/Milestone:
-
Start date:
2018-12-20
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

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 @x or $x or 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.

History

#1 Updated by Michael Kay almost 3 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.9 added

#2 Updated by Michael Kay almost 3 years ago

Fixed a couple of cases where this was leading to test failures (e.g. syntax errors not detected).

#3 Updated by O'Neil Delpratt almost 3 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.1.1 added

Bug fix applied to the Saxon 9.9.1.1 maintenance release.

#4 Updated by O'Neil Delpratt almost 3 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF