This directory contains isolated performance benchmarks for the BoreasLite ring buffer implementation used in Argus. The benchmarks are separated from the main test suite to provide accurate performance measurements without interference from intensive unit tests.
All benchmarks were executed on AMD Ryzen 5 7520U.
BenchmarkBoreasLite_SingleEvent-8 47011258 25.63 ns/op 39.02 Mops/sec 0 B/op 0 allocs/op
- Latency: 25.63 nanoseconds per operation
- Throughput: 39.02 million operations per second
- Memory: Zero allocations in hot path
BenchmarkBoreasLite_WriteFileEvent-8 67764067 53.20 ns/op 18.80 Mops/sec 0 B/op 0 allocs/op
- Latency: 53.20 nanoseconds per operation
- Throughput: 18.80 million operations per second
- Memory: Zero allocations
BenchmarkBoreasLite_MPSC-8 31231618 34.77 ns/op 28.76 Mops/sec 0 B/op 0 allocs/op
- Latency: 34.77 nanoseconds per operation under concurrent load
- Throughput: 28.76 million operations per second
- Scalability: Performance maintained across multiple producers
BenchmarkBoreasLite_vsChannels/BoreasLite-8 23317405 45.72 ns/op 21.87 Mops/sec 0 B/op 0 allocs/op
BenchmarkBoreasLite_vsChannels/GoChannels-8 18621222 61.43 ns/op 16.28 Mops/sec 0 B/op 0 allocs/op
- BoreasLite: 21.87 million ops/sec
- Go Channels: 16.28 million ops/sec
- Improvement: 34.3% faster than native Go channels
BenchmarkBoreasLite_HighThroughput-8 27012850 53.88 ns/op 18.56 Mops/sec 0 B/op 0 allocs/op
- Sustained throughput: 18.56 million operations per second
- Buffer size: 8192 events
- Strategy: Large batch optimization
- Type: Multiple Producer Single Consumer (MPSC)
- Synchronization: Lock-free atomic operations
- Memory Layout: Cache-line aligned, power-of-2 sizing
- Event Size: 128 bytes (2 cache lines)
- SingleEvent: Ultra-low latency for 1-2 files (25ns)
- SmallBatch: Balanced performance for 3-20 files
- LargeBatch: High throughput for 20+ files with 4x unrolling
- Zero allocations in all hot paths
- Fixed memory footprint: 8KB + (128 bytes × buffer_size)
- Cache efficiency: Power-of-2 ring buffer with atomic sequence numbers
Execute all benchmarks:
go test -bench="BenchmarkBoreasLite.*" -run=^$ -benchmemExecute specific benchmark:
go test -bench=BenchmarkBoreasLite_SingleEvent -run=^$ -benchmemExecute with multiple iterations:
go test -bench="BenchmarkBoreasLite.*" -run=^$ -benchmem -count=3github.com/agilira/argus: Main library (via replace directive)github.com/agilira/go-timecache: High-performance timestamp caching
- Benchmarks use minimal processing functions to isolate ring buffer performance
- All measurements include complete write-to-process cycles where applicable
- MPSC benchmarks use GOMAXPROCS concurrent producers
- Results represent sustainable performance under continuous load