Skip to content

PureXML 0.4.5

Choose a tag to compare

@mihaelamj mihaelamj released this 25 Jun 21:08
· 53 commits to main since this release
f6802c1

Two more XPath document-order quadratic fixes. Backward compatible, results identical.

Fixed

  • Sorting an element's attributes into document order was O(K²) in the attribute count (a linear scan per attribute); now O(K) via a cached per-owner name-to-index map. An 8000-attribute element: ~0.18s -> ~0.01s (~16x) (#305).
  • The following-sibling/preceding-sibling axes scanned a wide parent's child list to locate the context node per call, and materialized every sibling before filtering. They now use the shared sibling-index cache and fuse the node test into the walk (#306).

These complete a sweep of the XPath document-order width-quadratics (alongside firstInDocumentOrder, key()/id()/EXSLT set functions, and the following/preceding axes in 0.4.3–0.4.4); every XPath-using subsystem (XSLT, Schematron, XPointer) benefits.

Verification

Full suite (1740 tests), the W3C XML conformance, RELAX NG, Apache Xalan XSLT gold-output, and C14N corpora, plus the WASM build, all green across macOS, Linux, and Windows. swiftformat and swiftlint --strict clean.

Full changelog: https://github.com/mihaelamj/PureXML/blob/main/CHANGELOG.md