$ show openacid/slim
openacid/slim is a Go library for building memory-efficient, serializable trie indexes and sparse arrays, primarily designed for in-memory indexing of large on-disk key-value data. The core artifact is SlimTrie, a compressed trie that achieves roughly 11 bits per key while supporting fast Get, range queries, prefix scans, and versioned marshal/unmarshal. The repository also contains a standalone sparse-array package and a type-safe encoder framework, with extensive benchmarks comparing against Go maps and btree indexes. Its architecture is modular: the trie package defines the index structure, the array package provides bitmap-backed dense/sparse storage primitives, and the encode package abstracts value serialization with generated concrete implementations.
The LLM identified 3 files worth highlighting for reuse:
Core SlimTrie implementation: a memory-compressed trie using bitmap rank/select structures, short-node optimizations, and multiple prefix-storage modes. It is reusable as a standalone index primitive and demonstrates non-obvious engineering in bit-level compression and query acceleration.
Defines the Encoder interface and code-generated typed encoders for integers, strings, and fixed-size structs. This package cleanly separates value serialization from trie storage, making it reusable in any serialization context and showcasing a disciplined generator-driven design.
A bitmap-backed sparse array base with typed variants (U16, U32, etc.) generated from templates. It implements compact presence-encoded storage with fast access, and can be extracted as a general-purpose sparse data structure with minimal modification.