Kira KV Engine
kira_kv_engine builds a static key -> id index for unique keys.
- Default MPH backend:
PtrHash2025(fast build + fast lookup) - Optional numeric mode:
PGM+ MPH remap (auto_detect_numeric = true) - Stable lookups after build: index in
[0..n)
Install
[]
= ">=0.3"
Quick Start
use IndexBuilder;
Backends
Selectable via IndexBuilder::with_backend(...):
BackendKind::PtrHash2025(default)BackendKind::PTHashBackendKind::CHDBackendKind::RecSplitBackendKind::BBHash(only withbbhashfeature)
Backends are selected via BackendKind; only currently supported variants are available.
Numeric Auto-Detect (PGM)
If every key is exactly 8 bytes (u64::to_le_bytes()), you can enable numeric mode:
use IndexBuilder;
let keys: = .map.collect;
let index = new
.auto_detect_numeric
.build_index?;
# Ok::
In this mode:
lookup_u64is the native pathrange(min, max)returns matching index ids
Build/Perf Controls
IndexBuilder supports:
.with_parallel_build(bool).with_build_fast_profile(bool).with_mph_config(...)(gamma,rehash_limit,salt).with_backend(...)
Serialization
let bytes = index.to_bytes?;
let restored = from_bytes?;
Benchmarks
Run:
The benchmark outputs include:
- build time / build rate
- cold & warm lookup latency
- hit/miss ratios
- memory usage (bytes per key)
Notes
- Input keys must be unique.
- Indexes are static (rebuild on keyset change).
- Public API reference:
API.md.
License
MIT