PureXML/Sources/XPath
Mihaela Mihaljevic b8dbf8e97a perf(xpath): compute document-order keys once per sort
Node-set ordering previously recomputed both nodes' root paths on every
precedes comparison (treePath is O(depth x siblings), so sorts were
O(n log n x depth)). Add decorate-sort-undecorate helpers,
sortedByDocumentOrder() and firstInDocumentOrder(), that compute each node's
order key once, and switch the evaluator's order-and-dedup, the EXSLT set
functions, string-value coercion, and NodeFunctions' target lookup to them.
set:leading/trailing also decorate once, reusing the keys for the pivot
filter and the final sort. precedes stays for pairwise use, sharing the
key comparator (Node.ordered). Behavior unchanged, all suites green.

Closes #113
2026-06-10 03:39:19 +02:00
..
Axis.swift
AxisNavigation.swift
Compiler.swift
CompilerPaths.swift
CoreFunctions.swift
EvaluationContext.swift
Evaluator.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00
EvaluatorOperators.swift
EvaluatorSteps.swift
Expression.swift
EXSLTFunctions.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00
NodeFunctions.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00
NodeTest.swift
Query.swift
QueryError.swift
Selection.swift
Step.swift
StringFunctions.swift
Value.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00
XPathNode.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00