Performance characteristics and scaling of RingMPSC
mainRingMPSC is designed for extreme throughput by being memory-bandwidth bound rather than synchronization bound. It achieves near-linear scaling up to 6 producers (95%+ efficiency) and maintains ~80% efficiency at 8 producers on modern hardware (e.g., Zen 3).
Throughput Benchmarks (8P1C)
| Message Type | Throughput (Billion msgs/s) |
|---|---|
u32 (4B) | 180 B/s |
u64 (8B) | 93 B/s |
Key Performance Drivers
- Ring Decomposition: Each producer has its own ring, allowing producers to write into their own L2 cache without contention.
- Batch Amortization: Using large batches (e.g., 32K) amortizes the cost of atomic operations (
reserve,commit,consume). - Cache Isolation: Hot variables are separated by 128 bytes to prevent false sharing and assist prefetcher isolation.
- Memory Bandwidth: Throughput is primarily limited by the L2/L3 cache bandwidth and memory controller coherency traffic rather than lock contention.