Project

Profile

Help

Feature #4078

closed

Fast XPath parsing for simple expressions

Added by Michael Kay over 5 years ago. Updated about 5 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.

Actions #1

Updated by Michael Kay over 5 years ago

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

Updated by Michael Kay over 5 years ago

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

Actions #3

Updated by O'Neil Delpratt about 5 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.

Actions #4

Updated by O'Neil Delpratt about 5 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF