summaryrefslogtreecommitdiff
path: root/tests/test_xpath_paths.cpp
AgeCommit message (Collapse)Author
2017-01-30tests: Add more coverage testsArseny Kapoulkine
Expand out of memory coverage during XPath parsing and evaluation and add some other small tests.
2014-11-19tests: Fix tests on various compilersArseny Kapoulkine
Some compilers don't handle NaNs properly. Some compilers don't implement fmod in a IEEE-compatible way. Some compilers have exception handling codegen bugs (DMC...).
2014-11-01tests: Improve test coverageArseny Kapoulkine
2014-10-27XPath: Optimize [position()=expr] and [last()]Arseny Kapoulkine
To get more benefits from constant predicate/filter optimization we rewrite [position()=expr] predicates into [expr] for numeric expressions. Right now the rewrite is only for entire expressions - it may be beneficial to split complex expressions like [position()=constant and expr] into [constant][expr] but that is more complicated. last() does not depend on the node set contents so is "constant" as far as our optimization is concerned so we can evaluate it once.
2014-10-26XPath: Optimize constant filters/predicatesArseny Kapoulkine
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()]).
2014-10-23tests: Improve test coverageArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1074 99668b35-9821-0410-8761-19e4c4f06640
2014-10-21tests: Fix PUGIXML_WCHAR_MODE compilationArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1071 99668b35-9821-0410-8761-19e4c4f06640
2014-10-21XPath: Make sure step_push is called with valid nodesArseny Kapoulkine
Some steps relied on step_push rejecting null inputs; this is no longer the case. Additionally stepping now more rigorously filters null inputs. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1069 99668b35-9821-0410-8761-19e4c4f06640
2014-10-20XPath: Introduce _first/_any set evaluation modesArseny Kapoulkine
Sometimes when evaluating the node set we don't need the entire set and only need the first element in docorder or any element. In the absence of iterator support we can still use this information to short-circuit traversals. This does not have any effect on straightforward node collection queries, but frequently improves performance of complex queries with predicates etc. XMark benchmark gets 15x faster with some queries enjoying 100x speedup on 10 Mb dataset due to a significant complexity improvement. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1067 99668b35-9821-0410-8761-19e4c4f06640
2014-10-18XPath: Extend the descendant-or-self optimizationArseny Kapoulkine
Use descendant-or-self::node() transformation for self, descendant and descendant-or-self axis. Self axis should be semi-frequent; descendant axes should not really be used with // but if they ever are the complexity of the step becomes quadratic so it's better to optimize this if possible. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1063 99668b35-9821-0410-8761-19e4c4f06640
2014-10-16XPath: Optimize attribute axis lookupArseny Kapoulkine
When looking for an attribute by name, finding the first attribute means we can stop looking since attribute names are unique. This makes some queries faster by 40%. Another very common pattern in XPath queries is finding an attribute with a specified value using a predicate (@name = 'value'). While we perform an optimal amount of traversal in that case, there is a substantial overhead with evaluating the nodes, saving and restoring the stack state, pushing the attribute node into a set, etc. Detecting this pattern allows us to use optimized code, resulting in up to 2x speedup for some queries. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1061 99668b35-9821-0410-8761-19e4c4f06640
2014-10-15XPath: Fix optimization bug with //name[last()]Arseny Kapoulkine
The actual condition for the optimization is invariance from context list -- this includes both position() and last(). Instead of splitting the posinv concept just include last() into non-posinv expressions - this requires sorting for boolean predicates that depend on last() and do not depend on position(). These cases should be very rare. git-svn-id: https://pugixml.googlecode.com/svn/trunk@1060 99668b35-9821-0410-8761-19e4c4f06640
2014-10-05tests: Add XPath sorting testArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1054 99668b35-9821-0410-8761-19e4c4f06640
2014-10-05tests: Add XPath sorting tests and a simple test for numeric predicatesArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1051 99668b35-9821-0410-8761-19e4c4f06640
2014-09-23tests: Add one more XPath optimization testArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1022 99668b35-9821-0410-8761-19e4c4f06640
2014-09-23tests: More XPath testsArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1020 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29tests: Minor fixesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@691 99668b35-9821-0410-8761-19e4c4f06640
2010-08-29tests: Added XPath tests for attribute contextarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@664 99668b35-9821-0410-8761-19e4c4f06640
2010-07-19Set svn:eol-style to native for all text filesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@607 99668b35-9821-0410-8761-19e4c4f06640
2010-05-30tests: Added more Xalan testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@473 99668b35-9821-0410-8761-19e4c4f06640
2010-05-30tests: Added tests for principal node types with attributes for all axes ↵arseny.kapoulkine
that can return attributes git-svn-id: http://pugixml.googlecode.com/svn/trunk@471 99668b35-9821-0410-8761-19e4c4f06640
2010-05-29tests: Added more Xalan testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@467 99668b35-9821-0410-8761-19e4c4f06640
2010-05-29tests: Added some axis Xalan tests, extended all axis tests to include ↵arseny.kapoulkine
attribute context nodes git-svn-id: http://pugixml.googlecode.com/svn/trunk@465 99668b35-9821-0410-8761-19e4c4f06640
2010-05-09Removed document order optimization (it helps on a tiny percentage of ↵arseny.kapoulkine
queries), XPath tests now compute their own order git-svn-id: http://pugixml.googlecode.com/svn/trunk@400 99668b35-9821-0410-8761-19e4c4f06640
2010-05-06Integrated changes from unicode branch to trunkarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: Final coverage improvementsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@229 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: More coverage testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@225 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: Extracted generic tests in a separate header, better filter tests, ↵arseny.kapoulkine
some API tests added git-svn-id: http://pugixml.googlecode.com/svn/trunk@221 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: Mostly complete coverage of XPath W3Carseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@217 99668b35-9821-0410-8761-19e4c4f06640
2009-11-08tests: Added node test tests, added abbreviated step/axis testsarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@212 99668b35-9821-0410-8761-19e4c4f06640
2009-11-04tests: Completed function library tests, added namespace axis and variable ↵arseny.kapoulkine
reference tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@204 99668b35-9821-0410-8761-19e4c4f06640
2009-11-03tests: Added tests for all axes except namespacearseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@201 99668b35-9821-0410-8761-19e4c4f06640