3 ms·
If you're pulling from a queue use a ring buffer.
by pornel 4y ago
If you're pulling from a queue use a ring buffer.
- AstralStorm 4y agoSometimes. Depends on whether you are filling in a data buffer or trying to send an already calculated data buffer. A standard ring buffer does copies/fill. A ring buffer of pointers has similar performance characteristics to a linked list.
- Phelinofist 4y agoOT but does anyone know a general purpose ring buffer implementation for Java?
- grogers 4y agoLMAX disruptor: https://lmax-exchange.github.io/disruptor/user-guide/index.html https://lmax-exchange.github.io/disruptor/user-guide/index.h... It's used by log4j2 and several other java libraries and is quite solid. You can use it in blocking or polling modes, so it's quite generic depending on your latency requirements.
- speed_spread 4y agoUnfortunately log4j2 is no longer a shining example of good engineering, if you're trying to sell something... I'd prefer saying LMAX is / was used as the core of high frequency trading applications.