Skip to content

feat(theta): serialize union results directly - #333

Open
Aschenbath wants to merge 1 commit into
apache:mainfrom
Aschenbath:feat/320-theta-union-serialization
Open

Aschenbath wants to merge 1 commit into
apache:mainfrom
Aschenbath:feat/320-theta-union-serialization

Conversation

@Aschenbath

Copy link
Copy Markdown

Closes #320. Related to the Theta comparison suggested in #322, with a separate branch based on main.

Adds ThetaUnion::serialize(ordered) for uncompressed compact output. It reuses the existing union result preparation and shares the compact encoder. The encoder can also serve a future intersection or mutable-compaction path once that operation produces canonical state. An uninitialized intersection would still need to be handled before encoding.

  • cargo x test: 815 tests passed with the pinned TCK fixtures.
  • cargo x check and all eight benchmark smoke cases passed.
  • Compared against to_sketch(ordered).serialize() on Linux x86_64, Rust 1.99.1, via cargo x bench -- theta::serde --raw. Five repetitions, medians in milliseconds (via compact → direct): 40 inputs unordered 57 → 46, ordered 83 → 70, 8,000 inputs unordered 86 → 87, ordered 225 → 223. The measured ranges overlap.
  • An isolated counting allocator measured the same allocation/reallocation counts and requested bytes for both paths: 6 calls/1,328 bytes at 40 inputs and 13 calls/163,832 bytes at 8,000 inputs for either ordering. Result preparation still uses the existing scratch vector. These measurements do not establish a general speed or allocation improvement.

AI-assisted with Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(theta): serialize union results directly

1 participant