Tagged articles
cache line
12 articles · Page 1 of 1
The article explains CPU cache hierarchy, false sharing, cache-friendly data layouts (hot/cold separation, row-major traversal, SoA vs AoS), profiling with perf and Cachegrind, and real-world cases where cache-aware changes yielded 6.8x throughput improvement and reduced CPU usage from 87% to 51%.
AoS vs SoACPU cachecache line
0 likes · 28 min read

This article explains CPU cache hierarchy, cache line structure, mapping policies, write strategies, and MESI coherence protocol with C++ benchmarks showing 8x speedups from row-major traversal, struct alignment, and false sharing elimination using alignas(64) and hardware_destructive_interference_size.
C++CPU cacheCache-Friendly Code
0 likes · 20 min read

This article explains how false sharing occurs when independent threads modify variables on the same CPU cache line, triggering MESI protocol overhead that degrades performance, and covers detection methods using perf and VTune plus mitigation techniques like cache-line padding and thread-local storage.
CPU cacheMESI protocolcache line
0 likes · 22 min read

The article explains that in multithreaded programs, even when threads operate on independent data, the CPU may still suffer severe performance loss due to false sharing of cache lines, and shows how cache‑line alignment and C++17 hardware‑aware constants can eliminate the problem.
C++Multithreadingcache line
0 likes · 10 min read

This article explains the organization of main memory, covering memory slots, channels, controllers, DIMM modules, ranks, banks, burst mode, and the step‑by‑step process by which a memory request is serviced and a cache line is filled.
DIMMDRAMMemory Architecture
0 likes · 12 min read

This article explains the concept of CPU cache false sharing, how it degrades performance on multi‑core systems, and provides practical techniques—including cache‑line alignment macros and padding strategies—to prevent it and improve multithreaded application efficiency.
CPU cacheMultithreadingcache line
0 likes · 10 min read

This article explains the structure of modern CPU caches, the principles of cache lines, associativity, and coherence protocols, and demonstrates how these hardware details affect program performance through multiple code examples covering loop stride, matrix traversal, multithreading, and false sharing.
CPU cacheMultithreadingcache coherence
0 likes · 21 min read

Baidu engineers boost C++ backend latency and cost efficiency by eliminating unnecessary string zero‑initialization, using zero‑copy split with SIMD, replacing deep protobuf merges with repeated string fields, employing job‑scoped arenas and custom memory resources for allocation, and applying prefetching, cache‑line awareness, and tuned memory‑order semantics, achieving multiplicative to order‑of‑magnitude speedups.
Memory Accesscache linejob arena
0 likes · 31 min read

The article demonstrates how Top‑down Micro‑architecture Analysis Methodology (TMAM) can quickly pinpoint CPU bottlenecks—such as front‑end, back‑end, and bad speculation stalls—in a simple C++ accumulation loop, and shows that applying targeted compiler, alignment, and branch‑prediction optimizations reduces runtime by roughly 34 % while increasing retiring slots.
C++CPU performanceTMAM
0 likes · 20 min read

This article explains the concept of false sharing in CPU caches, demonstrates its performance impact with Java code, analyzes the results, and shows how to prevent it using the @Contended annotation and appropriate JVM flags.
CPU cacheContended annotationJava performance
0 likes · 9 min read

False sharing occurs when multiple threads modify variables that reside on the same CPU cache line, causing unnecessary cache coherency traffic; this article explains cache line basics, CPU cache hierarchy, MESI protocol, and presents Java solutions—including padding, @sun.misc.Contended annotation, and JVM flags—to prevent performance degradation.
Java Concurrencycache linefalse sharing
0 likes · 9 min read

This article explains why CPU caches are needed, the evolution to multi‑level caches, the concept of cache lines, practical experiments demonstrating their impact, and how different cache organization strategies such as fully associative, direct‑mapped, and N‑way set‑associative affect performance and eviction policies.
cache architecturecache linememory hierarchy
0 likes · 14 min read
