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 feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
AxisNavigation.swift feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
Compiler.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
CompilerPaths.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
CoreFunctions.swift feat(xslt): add xsl:key/key(), format-number(), xsl:number, and document() 2026-06-08 08:01:17 +02:00
EvaluationContext.swift feat(xpath): EXSLT common, math, and sets extension functions 2026-06-09 18:31:50 +02:00
Evaluator.swift perf(xpath): compute document-order keys once per sort 2026-06-10 03:39:19 +02:00
EvaluatorOperators.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
EvaluatorSteps.swift feat(xpath): eval-time namespace context and XPointer xmlns()/xpath1() schemes 2026-06-08 16:00:15 +02:00
Expression.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
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 feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
Query.swift feat(xpath): eval-time namespace context and XPointer xmlns()/xpath1() schemes 2026-06-08 16:00:15 +02:00
QueryError.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
Selection.swift feat(xpath): add an XPath 1.0 location-path subset 2026-06-08 01:32:23 +02:00
Step.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
StringFunctions.swift feat(xslt): add xsl:key/key(), format-number(), xsl:number, and document() 2026-06-08 08:01:17 +02:00
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