🚀New Concurrent LRU Hash Table for Demanding Workloads
High-performance hash table eliminates global lock contention
TL;DR
A high-performance concurrent LRU hash table designed to eliminate global lock contention by partitioning data into independent shards. Each shard operates autonomously, providing O(1) average-time operations for insertion, lookup, and removal.
Google has introduced a new concurrent LRU hash table optimized for demanding systems programming workloads. This solution eliminates the need for global locks by partitioning data into independent, cache-aligned shards. Each shard handles its own exclusive TTAS spinlock, metadata counters, and contiguous 'Mega-Block' of memory. The implementation prioritizes mechanical sympathy, cache locality, lock scalability, and predictable memory behavior, delivering high throughput in environments where standard library containers degrade under contention. This is a big deal for anyone working with High-Frequency Trading (HFT) infrastructure, Storage subsystem caches, Real-time network routing, Kernel/driver components, or High-throughput web servers.
Key Points
The solution splits data into independent shards based on processor topology (shards ≈ CPU cores × 32), ensuring optimal distribution across physical CPU sockets.
Threads are routed using MurmurHash3-style avalanche mixer to force entropy into the lower bits, enhancing performance and scalability.
Each shard operates autonomously with its own exclusive TTAS spinlock, metadata counters, and contiguous 'Mega-Block' of memory containing bucket and node arrays.
The table never calls new or delete once initialized, achieving zero runtime allocations while maintaining O(1) average-time operations for insertion, lookup, and removal.
Linked lists (LRU chains and Hash collisions) are implemented using 32-bit array indices instead of standard 64-bit pointers, improving cache locality and performance.
Why It Matters
If you're working with High-Frequency Trading systems or Storage subsystem caches, this new hash table could significantly improve your system's throughput. The implementation prioritizes mechanical sympathy, cache locality, lock scalability, and predictable memory behavior, making it ideal for demanding environments where standard library containers degrade under contention.
Frequently Asked Questions
Why does this matter?
If you're working with High-Frequency Trading systems or Storage subsystem caches, this new hash table could significantly improve your system's throughput. The implementation prioritizes mechanical sympathy, cache locality, lock scalability, and predictable memory behavior, making it ideal for demanding environments where standard library containers degrade under contention.
What happened?
A high-performance concurrent LRU hash table designed to eliminate global lock contention by partitioning data into independent shards. Each shard operates autonomously, providing O(1) average-time operations for insertion, lookup, and removal.
Comments
Be the first to comment
Enjoyed this article?
Get it daily. 7am. Free. Reads in 5 minutes.
Join 3,009 builders reading daily.