Skip to content

Releases: gustawdaniel/compact-dict

rkyv support and zero-copy mmap lookups

11 Mar 16:39

Choose a tag to compare

This release introduces support for zero-copy deserialization via the rkyv framework. It enables the dictionary to be mapped into memory and queried directly without allocations or data movement.

Key Changes:

  • rkyv Integration: Added rkyv::Archive, Serialize, and Deserialize traits to Dict and KeysContainer (optional via rkyv feature flag).
  • Zero-copy Lookups: Implemented get and contains for ArchivedDict, allowing lookups directly on serialized byte buffers or mmaps.
  • Miri Validation: Verified pointer arithmetic in archived lookups to ensure no undefined behavior (UB) during relative offset resolution.
  • Performance: Standard in-memory operations remain unaffected. Archived lookups use scalar probing to maintain safety and cache density.

Usage:

[dependencies]
compact-dict = { version = "0.1.1", features = ["rkyv"] }