Repository navigation
perf(theta): pack compressed sketches word by word - #342
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the compressed Theta serialization changes.
No open issues 🎉
What changed in this PR
This PR optimizes compressed Theta sketch serialization and deserialization with word-based bit packing while preserving the serial version 4 byte format.
Changes:
- Replaces block-based packing and unpacking with word-based operations.
- Adds round-trip and expected-payload checks for all entry widths from 1 to 63 bits.
- Removes the obsolete module declaration and documents the performance improvement.
| File | Description |
|---|---|
datasketches/src/thetafamily/theta/sketch.rs |
Implements word-based packing and unpacking and adds entry-width coverage. |
datasketches/src/thetafamily/theta/mod.rs |
Removes the bit_pack module declaration. |
CHANGELOG.md |
Records faster compressed Theta serialization and deserialization. |
Review effort: Balanced
Member
Author
|
@tisonkun thanks for your review and for adding the extra safeguard for invalid hashes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the unrolled per-width bit-packing module with word-based packing and unpacking for compressed (serial version 4) Theta sketches. The serialized bytes are unchanged.
bit_pack.rs(5,401 lines) and adds a round-trip test for every entry width.thetafeature takes 0.45 s instead of 1.35 s in release mode, and 0.38 s instead of 0.78 s in debug mode..rlib(thetafeature only) shrinks from 1.66 MB to 0.86 MB.🤖 Generated with Claude Code