summaryrefslogtreecommitdiff
path: root/tests/test_xpath_xalan_4.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-26 09:37:18 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-26 09:37:18 -0700
commitd5e29292c67c24b5cd7ac4f6afce2f8ec293144a (patch)
tree9e454ea5ac1c27697aecbb4dac5d4f542d6c9ceb /tests/test_xpath_xalan_4.cpp
parentf31c14e1fdcbd6e406e7e2bea21b303853e028e3 (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_xpath_xalan_4.cpp')
0 files changed, 0 insertions, 0 deletions