✳flâneur — a map of the web's best reading
Why the Ring Buffer is the Foundation of High-Performance Systems - DEV Community
dev.to · 940 words · saved by 1 readers
TL;DR: Array-based queues are often dismissed due to O(n) shifting costs, but the ring buffer...
TL;DR: Array-based queues are often dismissed due to O(n) shifting costs, but the ring buffer circumvents this by using wrapping head and tail pointers. This design provides O(1) access and superior cache locality, making it the industry standard for CPU scheduling, video buffering, and high-performance data streaming. I’ve seen plenty of developers dismiss array-based queues as a rookie mistake, but the hardware you're using right now relies on them. On paper, it looks inefficient to use a fixed-size array for a queue because removing an element from the front forces an O(n) operation to move
Explore this link on the map →related reading
- Circular buffer - Wikipediaen.wikipedia.org
- abseil / Performance Hintsabseil.io
- What Every Programmer Should Know About Memorypeople.freebsd.org
- [2604.25681] SimdQuickHeap: The QuickHeap Reconsideredarxiv.org
- NYSRGnotes.ekzhang.com
- CS106B Classes and Dynamic Memoryweb.stanford.edu
- Queue (abstract data type) - Wikipediaen.wikipedia.org
- Buffer cache | CS 162 Project 3cs162.org
- Low Latency Java with the Disruptorblog.scottlogic.com
- Infographics: Operation Costs in CPU Clock Cycles - 6IT6it.dev
- abseil / Performance Hintsabseil.io
- Introduction to Real-time Systemsdesign.ros2.org