Tagged articles
false sharing
29 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 fundamentals, demonstrates common cache killers like row vs column traversal, vector vs list, and false sharing with benchmarks, and provides practical C++ optimization techniques including struct layout, AoS vs SoA, prefetching, pointer chasing avoidance, and object pools, emphasizing measurement with perf.
C#CPU cachePerformance Optimization
0 likes · 20 min read

This article presents a systematic approach to memory optimization across three dimensions—reducing allocation frequency, accelerating allocation speed, and improving memory usage efficiency—with practical C++ techniques including stack allocation, object pools, size-class allocators, huge pages, data structure packing, and false sharing prevention.
C#Memory Optimizationdata structure alignment
0 likes · 23 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 protocolPerformance Optimization
0 likes · 22 min read

The article dissects how Disruptor’s ring‑buffer architecture outperforms traditional BlockingQueue by eliminating lock contention, dynamic allocation, and cache‑line interference through pre‑allocated zero‑copy buffers, CAS‑based sequencing, cache‑line padding, batch processing, and tailored wait strategies, achieving millions of TPS.
BlockingQueueCache line paddingDisruptor
0 likes · 13 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#MultithreadingPerformance
0 likes · 10 min read

This article explains what false sharing is in Java, how cache lines and cache‑line invalidation cause performance penalties, and provides concrete code examples and @Contended annotation techniques to detect and fix false sharing for faster multithreaded applications.
CacheConcurrencyContended
0 likes · 10 min read

This article explains the hidden performance killer of cache false sharing in multicore Java applications, demonstrates its impact with benchmark code, and shows how padding, the @Contended annotation, and Caffeine's internal structures can eliminate the issue for faster execution.
CaffeineContendedJava concurrency
0 likes · 10 min read

This article explains the cache architecture behind false sharing, demonstrates its dramatic performance impact with benchmark code, and shows how Java's @Contended annotation and Caffeine's memory‑padding techniques can effectively eliminate the issue for high‑concurrency applications.
cache optimizationfalse sharingperformance tuning
0 likes · 10 min read

This article builds a practical hardware‑mind model by benchmarking Rust code to show how cache layout, prefetching, cache associativity, false sharing, pipeline stalls, and data dependencies affect the performance of row‑major versus column‑major traversals, random accesses, and multithreaded loops, and it offers concrete fixes such as cache‑line alignment.
CPU architecturePerformancePipeline
0 likes · 19 min read

This article explains the concept of false sharing caused by CPU cache line interactions, demonstrates how cache padding can mitigate the performance penalty, and provides Go benchmark code and results to illustrate the impact on multi‑core concurrency.
ConcurrencyPerformancecache padding
0 likes · 8 min read

The article uses Rust benchmarks to show how cache layout, prefetching, associativity, false sharing, pipeline stalls, and loop data dependencies impact performance, and demonstrates practical optimizations such as row‑major traversal, proper alignment, avoiding dependent loops, and leveraging sequential access to achieve near‑optimal speed.
CPU cachePerformance OptimizationRust
0 likes · 17 min read

The article shows how row‑major vs column‑major traversal, random access, cache‑set conflicts, false sharing, branch‑prediction failures, and loop‑carried data dependencies each degrade performance by tying Rust (and C++) code patterns to CPU cache behavior, prefetching, pipeline stalls, and vectorization limits, demonstrated through runnable benchmarks.
CPU cachePipelineRust
0 likes · 15 min read

Cache consistency spans icache‑dcache synchronization, multi‑CPU cache coherence, and device‑CPU interactions; the article explains the MESI protocol, demonstrates performance impacts with multithreaded code, explores prefetching, false sharing, mapping strategies, and practical tips for writing cache‑aware software.
CPUCacheCoherence
0 likes · 24 min read

This article introduces various Java queue implementations, explains the Disruptor framework’s architecture, demonstrates its usage with complete code examples, and analyzes core components such as RingBuffer, Sequencer, and WaitStrategy while addressing performance issues like false sharing and multi‑producer coordination.
DisruptorJavaconcurrent queue
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 cacheMultithreadingPerformance Optimization
0 likes · 10 min read

This article explains how Java objects are laid out in the JVM heap, why fields are reordered and padded for alignment, how false sharing degrades performance, and how the @Contended annotation and compressed oops help mitigate these issues, all backed by detailed diagrams and code examples.
JVMJavaMemory Layout
0 likes · 56 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 cacheMultithreadingPerformance Optimization
0 likes · 21 min read

This article explains CPU cache levels, cache line concepts, coherence protocols, and how cache‑friendly or cache‑unfriendly code patterns—including false sharing and stride access—affect program performance on modern multicore processors.
CPU cacheMultithreadingcache hierarchy
0 likes · 21 min read


ITPUBJun 27, 2021 · Fundamentals
This article explores the role of multi‑level caching—from distributed and local caches to direct memory and CPU cache—detailing performance gains, cache‑miss handling, consistency challenges, false sharing issues, and practical mitigation techniques such as approximate LRU, random TTL, delayed double‑delete, padding, and lock‑free designs.
CPU cacheCache ConsistencyCaching
0 likes · 13 min read

This article explains CPU architecture, cache hierarchy, the concept of cache lines, how false sharing degrades performance, mitigation techniques like cache‑line alignment, and the Linux scheduler's task prioritisation, virtual runtime, and run‑queue mechanisms for fair and real‑time execution.
CFSCPUCache
0 likes · 19 min read


JavaEdgeOct 8, 2020 · Backend Development
This article explains how the Disruptor library attains true lock‑free performance through single‑threaded writes, the use of memory barriers (volatile and happens‑before semantics), cache‑line alignment to eliminate false sharing, and a sequence‑barrier algorithm, providing code examples and practical optimization tips.
DisruptorJava concurrencyfalse sharing
0 likes · 5 min read

An in‑depth Java performance study explores LongAdder, compares it with AtomicLong and lock‑based counters using JMH, and walks through successive custom implementations (V0‑V5) that apply striping, modulo optimization, false‑sharing elimination, and advanced hash probing to approach or surpass LongAdder’s throughput.
JMHJava concurrencyLongAdder
0 likes · 16 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 concurrencyPerformance Optimizationcache line
0 likes · 9 min read

During a client’s upgrade test, a database’s compressed tables exhibited severe slowdown under concurrent full‑table scans, which we traced to CPU cache line false sharing in the decompression code; using Linux perf tools we identified the hotspot, aligned memory, and restored performance.
CPU cacheDatabase PerformanceLinux perf
0 likes · 13 min read

This article explains the concept of false sharing in Java, demonstrates its dramatic impact on multithreaded performance, and shows how adding cache‑line padding variables can eliminate write‑contention, turning a 5‑to‑1 slowdown into a significant speedup.
Cache line paddingJava concurrencyfalse sharing
0 likes · 9 min read

This article explains the concept of false sharing, its roots in CPU cache line contention and the MESI protocol, demonstrates its impact with Java benchmark code, and presents practical padding and alignment techniques to mitigate the performance degradation caused by false sharing.
CPU cacheJava concurrencyMESI protocol
0 likes · 15 min read
