Another LMAX disruptor port in go 1.25 with generics support.
TL;DR: for benchmarking, performance analysis and conclusion, refer to performance.md
LMAX disruptor is a High Performance Inter-Thread Messaging Library as an alternative to bounded queue, which makes use of padding to avoid memory false sharing, alignment of memory in stripe to be cache friendly etc.
This is a port in Go with generics support, NOTE, Go's approach to concurrency is "Don't communicate by sharing memory; share memory by communicating". Channel is the preferred method for concurrency. This port follows disruptor's approach for better performance.
- install latest go lang binary (1.25 and above)
- setup the project in IDE
running all unit testing cases
go test -timeout 30s -tags -race goDisruptor/internal
go test -timeout 30s -tags -race goDisruptor/pkg
go test -timeout 30s -tags -race goDisruptor/examplerunning all performance testing benchmarks
go test -benchmem -run=^$ -tags -race -bench . goDisruptor/internal
go test -benchmem -run=^$ -tags -race -bench . goDisruptor/pkg
go test -benchmem -run=^$ -tags -race -bench . goDisruptor/examplePlease refer to example
Distributed under the MIT License. See LICENSE.txt for more information.
Thanks to the LMAX-Disruptor project.