release: PureXML 0.4.4 (#304)
Stamp the following/preceding axis quadratic fix as 0.4.4: those axes shared no state across context nodes, rebuilding and linearly searching the whole document node list on each, and materialized the entire span before the node test. They now share a per-evaluation document-order cache, skip the context subtree by index arithmetic, and fuse the node test into the walk. A 200-context following:: query over a 20k-element document drops ~16s to ~6s (~2.6x); results identical.
This commit is contained in:
parent
0405850d6b
commit
2abb130757
@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.4.4] - 2026-06-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- The `following` and `preceding` axes no longer rebuild the whole document node list and linearly search it on every context node, which made them quadratic over many context nodes. They now share a per-evaluation cache of each document's ordered node list and a node-to-index map (the document does not change during evaluation), so the list is built once and a node's position is an O(1) lookup; `following` additionally skips the context's contiguous subtree by index arithmetic rather than filtering every descendant out. The step's node test is fused into the walk, so a node the test rejects is never copied out of the shared list (only the matches are materialized). The selected nodes and their order are unchanged. A 200-context `following::` query over a 20k-element document drops from about 16 s to about 6 s. Guarded by `FollowingPrecedingAxisTests`.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user