diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-10-26 09:37:18 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-10-26 09:37:18 -0700 |
commit | d5e29292c67c24b5cd7ac4f6afce2f8ec293144a (patch) | |
tree | 9e454ea5ac1c27697aecbb4dac5d4f542d6c9ceb /tests/test_parse_doctype.cpp | |
parent | f31c14e1fdcbd6e406e7e2bea21b303853e028e3 (diff) |
XPath: Optimize constant filters/predicates
If a filter/predicate expression is a constant, we don't need to evaluate it
for every nodeset element - we can evaluate it once and pick the right element
or keep/discard the entire collection.
If the expression is 1, we can early out on first node when evaluating the
node set - queries like following::item[1] are now significantly faster.
Additionally this change refactors filters/predicates to have additional
metadata describing the expression type in _test field that is filled during
optimization.
Note that predicate_constant selection right now is very simple (but captures
most common use cases except for maybe [last()]).
Diffstat (limited to 'tests/test_parse_doctype.cpp')
0 files changed, 0 insertions, 0 deletions