Expand description
Ring buffer implementations for streaming data processing
This module provides two distinct ring buffer implementations:
LocalRingBuffer: Single-threaded only, no synchronization, maximum performanceRingBuffer: Thread-safe withArc<RwLock>synchronization, safe for concurrent access
§Performance Characteristics
Both implementations provide:
- O(1) push and pop operations
- O(k) sliding window operations (k = window size)
- Bounded capacity with automatic overwrite of oldest elements
- Direct indexed access for efficient windowing
LocalRingBuffer advantages:
- No synchronization overhead
- ~2x faster than thread-safe variant
- Optimal for single-threaded streaming algorithms
RingBuffer advantages:
- Thread-safe with multiple readers/writers
- Suitable for concurrent streaming pipelines
Structs§
- Local
Ring Buffer - Single-threaded ring buffer optimized for maximum performance
- Ring
Buffer - Thread-safe ring buffer for streaming data