PureXML 0.4.1
Post-0.4.0 XPath performance work. Backward compatible, identical query results.
Performance (xpath vs libxml2, 20k-item generated corpus)
~5.5x -> ~1.3x slower than libxml2 across five passes:
- single-accumulator descendant traversal, replacing per-node array concatenation (#285)
- fuse the node test into the descendant walk, so a rejected node is never wrapped or reference-counted (#286)
- the same node-test fusion for the attribute axis (#287)
- share the focus-independent evaluation state (variables, functions, namespaces, budget) through one
Environmentreference instead of copying three dictionaries per node (#288) - compile the step node test once per query rather than per node, dropping a per-node namespace-dictionary retain on the dominant traversal, the single largest pass (#289)
Verification
Full local suite (1707 tests), Apache Xalan XSLT gold-output corpus, and the WASM cross-platform build, all green across macOS, Linux, and Windows. Each correctness-sensitive change (the three node-test fusions and the compiled node test) is covered by a dedicated differential test asserting the fast path selects exactly what the unfused path does, plus an adversarial equivalence review. swiftformat and swiftlint --strict clean.
Full changelog: https://github.com/mihaelamj/PureXML/blob/main/CHANGELOG.md