Expand description
Storage utilities for graph data.
This module provides compression and encoding utilities:
dictionary- Dictionary encoding for strings with low cardinalitydelta- Delta encoding for sorted integer sequencesbitpack- Bit-packing for small integersbitvec- Bit vector for boolean compressioncodec- Unified compression codec interface
§Compression Strategies
| Data Type | Recommended Codec | Compression Ratio |
|---|---|---|
| Sorted integers | DeltaBitPacked | 5-20x |
| Small integers | BitPacked | 2-16x |
| Strings (low cardinality) | Dictionary | 2-50x |
| Booleans | BitVector | 8x |
§Example
ⓘ
use graphos_core::storage::{TypeSpecificCompressor, CodecSelector};
// Compress sorted integers
let values: Vec<u64> = (100..200).collect();
let compressed = TypeSpecificCompressor::compress_integers(&values);
println!("Compression ratio: {:.1}x", compressed.compression_ratio());
// Compress booleans
let bools = vec![true, false, true, true, false];
let compressed = TypeSpecificCompressor::compress_booleans(&bools);Re-exports§
pub use bitpack::BitPackedInts;pub use bitpack::DeltaBitPacked;pub use bitvec::BitVector;pub use codec::CodecSelector;pub use codec::CompressedData;pub use codec::CompressionCodec;pub use codec::CompressionMetadata;pub use codec::TypeSpecificCompressor;pub use delta::DeltaEncoding;pub use delta::zigzag_decode;pub use delta::zigzag_encode;pub use dictionary::DictionaryBuilder;pub use dictionary::DictionaryEncoding;
Modules§
- bitpack
- Bit-packing for small integers.
- bitvec
- Bit vector for boolean compression.
- codec
- Unified compression codec enumeration.
- delta
- Delta encoding for sorted integer sequences.
- dictionary
- Dictionary encoding for string compression.