Store forwarding failure stalls loads in C benchmarks

lemire.me1 min read

Store forwarding fails when a memory load is wider than a preceding store or when the byte ranges only partly overlap, causing the load to stall until the store reaches the cache. The author examines this performance trap in C and demonstrates how working in registers can sidestep the issue. Performance benchmarks across various processors, including Intel Xeon, AMD EPYC, Amazon Graviton, and Apple Silicon, illustrate how different hardware handles mismatched store and load operations. Open article →