Skip to content
GitHub·

🚀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.

New Concurrent LRU Hash Table for Demanding Workloads — GitHub

Key Points

1

The solution splits data into independent shards based on processor topology (shards ≈ CPU cores × 32), ensuring optimal distribution across physical CPU sockets.

2

Threads are routed using MurmurHash3-style avalanche mixer to force entropy into the lower bits, enhancing performance and scalability.

3

Each shard operates autonomously with its own exclusive TTAS spinlock, metadata counters, and contiguous 'Mega-Block' of memory containing bucket and node arrays.

4

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.

5

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.

hash-tableconcurrent-programminglock-free-algorithmshigh-performance-systemscache-locality

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

Subscribe to join the conversation...

Be the first to comment

Enjoyed this article?

Get it daily. 7am. Free. Reads in 5 minutes.

Join 3,009 builders reading daily.

Also get