Xiao Lou's Tech Notes
May 19, 2020 · Backend Development
Can You Build a Faster Counter Than Java’s LongAdder? A Deep Dive
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 concurrencyfalse sharing
0 likes · 16 min read
