PureXML/Sources/Model
Mihaela Mihaljevic b672c49a84
perf(xpath): share value-Node projections across a result set (#349)
Mapping an ordered node-set to selections rebuilt each result as an
independent value Node through TreeNode.node, projecting that node's whole
subtree. For a result set whose nodes nest within one another (`//a` over a
deep chain, where every `a` contains all deeper ones) this materialized the
sum of their subtrees: quadratic. `//a` over an 8000-deep chain took ~19s.

The projection now threads a memo keyed by tree-node identity across one
result set. A tree node is projected once; a result that nests a
deeper one reuses its already-built value Node by reference, which the
copy-on-write Element storage (from the value-Node depth-safety work) makes
a shared, not copied, subtree. The set is built in one pass over the
distinct nodes. The same query now returns in ~0.04s and scales linearly.

The non-memoized `node` projection (serialization, value comparison) is
unchanged. Results are identical: 1787 tests pass, including the XPath and
XSLT value corpora. Closes #348.
2026-06-26 18:43:27 +02:00
..
Attribute.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
Element.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
ElementStorage.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
Node.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
QualifiedName.swift perf(parse): split the name prefix from a scanned colon offset (#292) 2026-06-25 12:23:53 +02:00
TreeNode.swift perf(model): make the TreeNode tree type depth-safe (#343) 2026-06-26 16:39:08 +02:00
TreeNodeConversion.swift perf(xpath): share value-Node projections across a result set (#349) 2026-06-26 18:43:27 +02:00
TreeNodeEditing.swift feat(model): TreeNode editing helpers (attributes, shallow copy, order, normalize) 2026-06-08 15:19:33 +02:00
TreeNodeIdentity.swift feat(model): first-class doctype/entity-reference/namespace nodes, ownerDocument, adoption (#90) 2026-06-09 03:43:24 +02:00
TreeNodeMutation.swift feat(model): mutable parent-aware tree (libxml2 tree.h parity) 2026-06-08 03:13:59 +02:00
TreeNodeNavigation.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
TreeNodeSpan.swift feat(schema): locate compile diagnostics with validation coding paths (#169) 2026-06-16 10:26:11 +02:00