Valkey kills the skiplist, cuts sorted set overhead by up to 43%(valkey.io)
204 points by reconditerose 12 days ago | 74 comments
tl;dr: Valkey 9.2 replaces the skiplist backing large sorted sets with "fbtree," a 61-way B+ tree variant featuring SIMD-accelerated inner-node searches, linked leaves, cached endpoints, and jemalloc-aligned node sizes. In benchmarks on a 5M-member set, per-member overhead dropped 36–43% (saving ~109MB), while ZADD and ZREM throughput jumped 105% and 76% respectively. The change is transparent except that OBJECT ENCODING now returns "btree" instead of "skiplist."
HN Discussion:
  • ~Competing Redis implementation claims even better memory savings using different techniques
  • ↑Skiplists were always a poor choice due to cache-miss issues on modern hardware
  • ~Other projects like Dragonfly already pioneered this B+ tree approach earlier
  • •Technical curiosity about implementation details like rank queries and back pointers
  • ↑Praise for the PR documentation quality and review process