1 unstable release
Uses new Rust 2024
new 0.1.0 | Mar 29, 2025 |
---|
#199 in Compression
42 downloads per month
73KB
2K
SLoC
Splinter
Splinter is a compressed bitmap format similar to Roaring, optimized specifically for small, sparse sets of 32-bit unsigned integers (u32
).
Key Features:
-
Tree-based Encoding: Splinter encodes
u32
values into a 256-way tree structure by decomposing integers into big-endian component bytes. Leaf nodes efficiently transition from byte lists to compact bitmaps at up to 32 values. -
Zero-copy Access: Designed for efficient querying without deserialization, the
SplinterRef
type allows direct, zero-copy reads from any type implementingAsRef<[u8]>
.
Serialized Format
header (4 bytes)
magic (2 bytes)
unused (2 bytes)
footer (4 bytes)
partitions (2 bytes)
unused (2 bytes)
block (cardinality)
cardinality == 256
data: OMITTED
cardinality < 32
data: [u8; cardinality]
else
data: [u8; 32]
index (cardinality, offset_size: u16|u32)
keys: block(cardinality)
cardinalities: [u8; cardinality] // 1 based
offsets: [offset_size; cardinality]
map (cardinality, off_type, val_type)
values: [val_type(index->cardinalities[i]); cardinality]
index (cardinality, off_type)
splinter
header
map (footer->partitions, u32,
map (cardinality, u32,
map (cardinality, u16, block)))
footer
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~1.6–2.2MB
~38K SLoC