XPath: Only call apply_predicates if necessary
In some cases constant overhead on step evaluation is important - i.e. for queries that evaluate a simple step in a predicate expression. Eliminating a redundant function call thus can prove worthwhile. This change makes some queries (e.g. //*[not(*)]) 4% faster.
This commit is contained in:
parent
db78f34054
commit
d854b0219d
@ -9025,13 +9025,13 @@ PUGI__NS_BEGIN
|
|||||||
if (axis != axis_self && size != 0) ns.set_type(xpath_node_set::type_unsorted);
|
if (axis != axis_self && size != 0) ns.set_type(xpath_node_set::type_unsorted);
|
||||||
|
|
||||||
step_fill(ns, *it, stack.result, once, v);
|
step_fill(ns, *it, stack.result, once, v);
|
||||||
apply_predicates(ns, size, stack, eval);
|
if (_right) apply_predicates(ns, size, stack, eval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
step_fill(ns, c.n, stack.result, once, v);
|
step_fill(ns, c.n, stack.result, once, v);
|
||||||
apply_predicates(ns, 0, stack, eval);
|
if (_right) apply_predicates(ns, 0, stack, eval);
|
||||||
}
|
}
|
||||||
|
|
||||||
// child, attribute and self axes always generate unique set of nodes
|
// child, attribute and self axes always generate unique set of nodes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user