From Skiplists to B+ Trees: Making Valkey Sorted Sets More Memory Efficient
Valkey replaces the skiplist used for large sorted sets with a purpose-built B+ tree, packing more entries per node to reduce pointer overhead and dependent memory fetches.
The design uses 61-way nodes, SIMD-assisted child selection and linked leaves for range scans. Sorted-set command behavior stays the same, but tools checking OBJECT ENCODING should expect btree rather than skiplist; small listpack-encoded sets are unaffected.