Repository navigation
perf(dsig): store node sets as ranges, vectors or bitsets - #237
Conversation
- Index every XPath node in document order when the semantic arena is built; a subtree with its attributes and namespaces is one index range. - Keep whole-document and subtree projections, minus excluded subtrees, as arena ranges: URI="", #id and enveloped exclusion store no per-node keys. - Store XPath and Filter 2.0 results as sorted index vectors with a block summary while sparse, and as bitsets from 1/128 of the document's nodes. - Keep set algebra exact across representations, charge right-hand reads to the current query, and keep entry, name-byte and filter-work limits at the values the per-node table charged. Measured against the previous hash table (16K elements, inclusive C14N): enveloped projection 17.7 ms -> 4.2 ms with peak memory 6.5 MB -> 1.05 MB (mostly the canonical output); explicit selections 3.5-4.5x faster. Randomized tests compare every representation with the previous table on tree, attribute and namespace membership and on canonical bytes. Closes #236
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1ca5667be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[High impact] No outstanding findings block merging the reviewed changes.
|
- Inserting an index already present in a whole-document or subtree projection no longer copies it into explicit storage first, so a union that adds nothing cannot fail on the query's memory account. - Walking members charges execution work for every emitted index, including each attribute and namespace node of a semantic subtree. - Compute the document-order XPath index only with XML signatures; the C14N-only build no longer carries the unused index. - The node-set benchmarks build each selection directly in the measured representation instead of converting after an automatic promotion; the threshold comment carries the re-measured medians. Regression tests cover the present-member union under a small memory account and the per-index work of materializing an attribute-heavy element.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1cb242185
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Filtering an explicit set charges one work unit per examined member in the sparse vector and per member held by each scanned bitset word, so a subtree exclusion that removes nothing still pays for its scan. - Excluding a subtree from a semantic projection charges each removed node's attribute and namespace axes, the search for its position among earlier exclusions and the exclusions moved to make room. Regression tests cover a no-op exclusion from sparse and dense explicit sets and the removal of an element with 4096 attributes.
Summary
Changes
u32is rejected as a node-limit violation.URI="",#idand enveloped-signature exclusion keep a range plus sorted excluded subtree ranges, with no per-node storage.u32vectors with a one-bit-per-64-indexes block summary while sparse, and bitsets from 1/128 of the document's nodes (threshold measured by the newnode_set_*benchmarks, seedocs/benchmarks.md).Testing
Closes #236
Summary by CodeRabbit
Performance
Bug Fixes
Documentation