Valkey Kills the Skiplist, Cutting Sorted Set Overhead by 43%
Valkey 9.2 phases out the legacy skiplist in favor of a cache-conscious B+ tree, delivering up to a 43% reduction in memory overhead and faster ordered-set workloads.
For more than fifteen years, in-memory data engines tracing their lineage back to Redis relied on William Pugh’s probabilistic skip list to power sorted sets. While elegant on paper, that architectural era is officially coming to a close. In the upcoming Valkey 9.2 release, the Linux Foundation-backed open-source project has discarded the classic skiplist in favor of a bespoke, cache-friendly B+ tree, cutting sorted set memory overhead by up to 43% while substantially boosting operational throughput.
When sorted sets were first implemented in early key-value stores, the skip list was favored for its implementation simplicity and predictable average-case O(log n) performance without requiring complex tree-rebalancing logic. However, modern processor architectures have evolved to heavily penalize non-contiguous memory access. As detailed in the official Valkey engineering disclosure, skiplists allocate isolated memory blocks for individual elements, interconnected through a web of randomized forward pointers. This model induces extreme heap fragmentation and constant CPU cache misses, forcing processor execution units to stall while waiting on main memory fetches during set traversals.
Valkey engineers solved this bottleneck by implementing a custom B+ tree specifically tailored for volatile, byte-addressable RAM rather than traditional block storage. Unlike conventional disk-bound database trees configured with large 4KB or 8KB pages, Valkey’s in-memory B+ tree utilizes compact node sizing that optimizes the balance between node-split overhead and L1/L2 cache locality. Leaf nodes pack elements sequentially into tight memory buffers, eradicating redundant pointer overhead and allowing modern hardware prefetchers to stream ordered datasets effortlessly through CPU execution pipelines.
The benchmark results validate the architectural shift. Across synthetic and production-modeled workloads, Valkey 9.2 demonstrated memory savings ranging between 30% and 43% for large sorted sets, directly proportional to element counts. Beyond shrinking RAM footprints, read-heavy operations such as range queries and rank-based lookups saw double-digit latency reductions. Sequential scans in operations like ZRANGEBYSCORE execute along continuous memory segments rather than jumping between fragmented heap addresses, delivering smoother tail latency profiles and higher aggregate requests per second.
The transition marks a pivotal turning point in the post-fork trajectory between Valkey and upstream proprietary distributions. Supported by major cloud operators, the Valkey development team is aggressively addressing entrenched technical debt that persisted for over a decade. By prioritizing raw memory density and modern hardware sympathy at the primitive data structure layer, Valkey 9.2 demonstrates that open-source infrastructure forks can move far beyond maintenance, delivering compounding bottom-line cloud compute savings to enterprises running high-cardinality ranking, streaming, and caching fleets.
Want real-time AI & tech intelligence dispatches?
Join the official TrendingTech Daily Telegram channel for breaking research, model launches, and market analysis.