r/cpp • • Mar 24 '26

Optimizing a Lock-Free Ring Buffer

https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/
104 Upvotes

58 comments sorted by

View all comments

Show parent comment

1

u/skebanga Mar 25 '26

Care to share details?

5

u/Bart_V Mar 25 '26

Caching is faster on average, when you measure total time of many operation. However, since you do more work on each push and pop, the worst case time per operation (latency) is longer. And for instance on real time systems you're more interested in optimizing worst case latency than throughput.